-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (48 loc) · 1.13 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
46
47
48
const webpack = require('webpack')
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const _entry = {
"index": './app/src/js/index.js',
};
module.exports = {
entry: _entry,
output: {
path: path.join(__dirname, 'app','dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.(scss|css)$/,
use: ExtractTextPlugin.extract({
use:[ 'css-loader','sass-loader'],
fallback: 'style-loader',
}),
},
{
test: /\.html$/,
loader: "raw-loader" // loaders: ['raw-loader'] is also perfectly acceptable.
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
],
},
plugins: [
new webpack.BannerPlugin('This file is created by Adam'),
new ExtractTextPlugin({
filename: 'index.css',
disable: false,
allChunks: true,
}),
new HtmlWebpackPlugin({
template: './app/src/index.html'
})
]
}