-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
executable file
·52 lines (49 loc) · 1.2 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
49
50
51
52
const webpack = require('webpack')
const config = {
context: __dirname + '/src',
entry: ['./index.js', './style.scss'],
output: {
path: __dirname + '/docs/assets',
filename: 'bundle.js',
publicPath: "assets/",
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
},
{ test: /\.(sass|scss|css)$/, use: ['style-loader','css-loader', 'sass-loader'] },
{ test: /\.(jpg|jpeg|gif|png)$/, loader:'url-loader?limit=1024&name=images/[name].[ext]' },
{ test: /\.(woff|woff2|eot|ttf|svg)$/, loader: 'url?limit=65000&name=fonts/[name].[ext]' }
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jQuery",
'window.jQuery': "jquery",
"Tether": 'tether'
})
],
devServer: {
contentBase: __dirname + '/src',
open: true,
port: 3000,
host: '0.0.0.0'
},
resolveLoader: {
moduleExtensions: ['-loader']
},
devtool: "eval-source-map"
};
if (process.env.NODE_ENV === "production") {
config.devtool = "source-map";
}
module.exports = config