-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.cjs
69 lines (67 loc) · 1.99 KB
/
webpack.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CspHtmlWebpackPlugin = require('csp-html-webpack-plugin')
const webpack = require('webpack')
module.exports = {
entry: './src/index.js',
mode: 'development',
devtool: 'cheap-source-map',
watch: true,
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
ignoreOrder: false, // Enable to remove warnings about conflicting order
})
, new webpack.ProvidePlugin({ m: "mithril" })
, new HtmlWebpackPlugin({
title: 'Vogula Chess',
meta: {
viewport: 'width=device-width, initial-scale=1',
'Access-Control-Allow-Origin': '*'
}
})
, new CspHtmlWebpackPlugin({
'script-src': [ /* "'unsafe-inline'", */"'self'" ]
})
],
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false
}
}
, {
test: /\.css$/,
include: [ path.resolve(__dirname, 'src') ],
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
//hmr: true
}
},
'css-loader',
'sass-loader'
]
}
, /*** SCSS ***/
{
test: /\.scss$/,
include: path.resolve(__dirname, 'src'),
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
}
]
},
output: {
filename: 'app.js',
path: path.resolve(path.resolve(), 'dist'),
}
}