-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.browser.dev.config.js
More file actions
54 lines (51 loc) · 1.22 KB
/
Copy pathwebpack.browser.dev.config.js
File metadata and controls
54 lines (51 loc) · 1.22 KB
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
const
path = require('path'),
webpack = require('webpack'),
mkdirp = require("mkdirp"),
bootstrap = require("bootstrap-styl"),
jeet = require("jeet"),
ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
app: './lib/browser/main.jsx'
},
output: {
filename: 'bundle-[hash].js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devtool: 'source-map',
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin("styles-[hash].css"),
function () {
this.plugin("done", function (stats) {
mkdirp.sync(path.join(__dirname, "target"));
require("fs").writeFileSync(
path.join(__dirname, "target", "rev-manifest.json"),
JSON.stringify(stats.toJson().assetsByChunkName));
});
}
],
stylus: {
use: [bootstrap(),jeet()]
},
module: {
loaders: [
{
test: /\.styl/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!stylus-loader")
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
},
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
}
]
}
};