Skip to content

Commit 634cf52

Browse files
authored
Merge pull request element-hq#3690 from t3chguy/fix_webpack_config
Fix Webpack conf
2 parents 2f3e389 + 08fb20a commit 634cf52

1 file changed

Lines changed: 18 additions & 20 deletions

File tree

‎webpack.config.js‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
var path = require('path');
2-
var webpack = require('webpack');
3-
var ExtractTextPlugin = require("extract-text-webpack-plugin");
4-
var HtmlWebpackPlugin = require('html-webpack-plugin');
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const HtmlWebpackPlugin = require('html-webpack-plugin');
55

66
module.exports = {
77
entry: {
@@ -19,11 +19,11 @@ module.exports = {
1919

2020
// CSS themes
2121
"theme-light": "./src/skins/vector/css/themes/light.scss",
22-
"theme-dark": "./src/skins/vector/css/themes/dark.scss"
22+
"theme-dark": "./src/skins/vector/css/themes/dark.scss",
2323
},
2424
module: {
2525
preLoaders: [
26-
{ test: /\.js$/, loader: "source-map-loader" }
26+
{ test: /\.js$/, loader: "source-map-loader" },
2727
],
2828
loaders: [
2929
{ test: /\.json$/, loader: "json" },
@@ -38,9 +38,7 @@ module.exports = {
3838
// would also drag in the imgs and fonts that our CSS refers to
3939
// as webpack inputs.)
4040
// 3. ExtractTextPlugin turns that string into a separate asset.
41-
loader: ExtractTextPlugin.extract(
42-
"css-raw-loader!postcss-loader?config=postcss.config.js"
43-
),
41+
loader: ExtractTextPlugin.extract("css-raw-loader!postcss-loader?config=postcss.config.js"),
4442
},
4543
{
4644
// this works similarly to the scss case, without postcss.
@@ -49,15 +47,18 @@ module.exports = {
4947
},
5048
],
5149
noParse: [
50+
// for cross platform compatibility use [\\\/] as the path separator
51+
// this ensures that the regex trips on both Windows and *nix
52+
5253
// don't parse the languages within highlight.js. They cause stack
5354
// overflows (https://github.com/webpack/webpack/issues/1721), and
5455
// there is no need for webpack to parse them - they can just be
5556
// included as-is.
56-
/highlight\.js\/lib\/languages/,
57+
/highlight\.js[\\\/]lib[\\\/]languages/,
5758

5859
// olm takes ages for webpack to process, and it's already heavily
5960
// optimised, so there is little to gain by us uglifying it.
60-
/olm\/(javascript\/)?olm\.js$/,
61+
/olm[\\\/](javascript[\\\/])?olm\.js$/,
6162
],
6263
},
6364
output: {
@@ -83,7 +84,7 @@ module.exports = {
8384
// various levels of '.' and '..'
8485
// Also, sometimes the resource path is absolute.
8586
return path.relative(process.cwd(), info.resourcePath).replace(/^[\/\.]*/, '');
86-
}
87+
},
8788
},
8889
resolve: {
8990
alias: {
@@ -106,16 +107,13 @@ module.exports = {
106107
plugins: [
107108
new webpack.DefinePlugin({
108109
'process.env': {
109-
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
110-
}
110+
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
111+
},
111112
}),
112113

113-
new ExtractTextPlugin(
114-
"bundles/[hash]/[name].css",
115-
{
116-
allChunks: true
117-
}
118-
),
114+
new ExtractTextPlugin("bundles/[hash]/[name].css", {
115+
allChunks: true,
116+
}),
119117

120118
new HtmlWebpackPlugin({
121119
template: './src/vector/index.html',

0 commit comments

Comments
 (0)