Skip to content

Commit 9b38a97

Browse files
committed
Fix Webpack conf
+ conform to a bit more eslint (IDE makes my eyes hurt) + specify windows-specific copies of noParse regexes to stop the olm error Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 9c27075 commit 9b38a97

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

‎webpack.config.js‎

Lines changed: 14 additions & 12 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" },
@@ -39,7 +39,7 @@ module.exports = {
3939
// as webpack inputs.)
4040
// 3. ExtractTextPlugin turns that string into a separate asset.
4141
loader: ExtractTextPlugin.extract(
42-
"css-raw-loader!postcss-loader?config=postcss.config.js"
42+
"css-raw-loader!postcss-loader?config=postcss.config.js",
4343
),
4444
},
4545
{
@@ -54,10 +54,12 @@ module.exports = {
5454
// there is no need for webpack to parse them - they can just be
5555
// included as-is.
5656
/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.
6061
/olm\/(javascript\/)?olm\.js$/,
62+
/olm\\(javascript\\)?olm\.js$/,
6163
],
6264
},
6365
output: {
@@ -83,7 +85,7 @@ module.exports = {
8385
// various levels of '.' and '..'
8486
// Also, sometimes the resource path is absolute.
8587
return path.relative(process.cwd(), info.resourcePath).replace(/^[\/\.]*/, '');
86-
}
88+
},
8789
},
8890
resolve: {
8991
alias: {
@@ -106,15 +108,15 @@ module.exports = {
106108
plugins: [
107109
new webpack.DefinePlugin({
108110
'process.env': {
109-
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
110-
}
111+
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
112+
},
111113
}),
112114

113115
new ExtractTextPlugin(
114116
"bundles/[hash]/[name].css",
115117
{
116-
allChunks: true
117-
}
118+
allChunks: true,
119+
},
118120
),
119121

120122
new HtmlWebpackPlugin({

0 commit comments

Comments
 (0)