-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (31 loc) · 1.01 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
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.join(__dirname, "/src"),
entry: [
'./main.js',
],
// Produces one output file called
// `bundle.js` in the dist directory.
//
// Webpack can do more complicated stuff,
// like code splitting.
output: {
filename: "bundle.js",
path: path.join(__dirname, "dist"),
},
module: {
// Process all files in the src directory
// through the babel system. The babel loader
// processes jsx and ES6 js.
loaders: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]') },
{ test: /\.(png|jpg|gif)$/, loader: 'url-loader?limit=8192'},
// { test: /\.json$/, loader: 'json-loader' },
],
},
plugins: [
new ExtractTextPlugin('style.css', { allChunks: true }),
],
}