forked from jeremybanka/vscode-theme-designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (44 loc) · 1.15 KB
/
webpack.config.js
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
const HtmlWebpackPlugin = require(`html-webpack-plugin`)
const { CleanWebpackPlugin } = require(`clean-webpack-plugin`)
const DotenvWebpackPlugin = require(`dotenv-webpack`)
module.exports = {
entry: `./src/js/app.js`,
output: {
path: `${__dirname}/dist`,
filename: `bundle.js`,
},
plugins: [
new DotenvWebpackPlugin(),
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: `Code Themer`,
favicon: `src/images/favicon.png`,
template: `src/index.html`, // template file
filename: `index.html`, // output file
inject: true,
}),
new HtmlWebpackPlugin({
title: `Export Result`,
favicon: `src/images/favicon.png`,
template: `src/export.html`, // template file
filename: `export.html`, // output file
inject: true,
}),
],
module: {
rules: [
{
test: /\.s[ac]ss$/,
use: [`style-loader`, `css-loader`, `sass-loader`],
},
{
test: /\.(svg|gif|png|eot|woff(2)?|ttf)$/,
use: [`url-loader`],
},
],
},
// dev-specific content
mode: `development`,
devtool: `source-map`,
devServer: { contentBase: `./dist` },
}