-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
69 lines (66 loc) · 2.03 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//webpack.config.js
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var ProgressPlugin = require('./progress-plugin');
var CachePlugin = require("webpack/lib/CachePlugin");
var myCache = {};
module.exports = {
name: 'server side webpack',
target: 'node',
entry: {
react: './example/App.jsx'
},
output: {
libraryTarget: 'commonjs2',
path: path.join(__dirname, 'example', 'dist'),
filename: 'webpack.output.js',
publicPath: 'images/'
},
resolve: {
root: __dirname,
fallback: __dirname + '/node_modules',
modulesDirectories: ['node_modules'],
extensions: ['', '.json', '.js', '.jsx', '.scss', '.png', '.jpg', '.jpeg', '.gif']
},
resolveLoader: {
root: __dirname,
alias: {
'lift-sass': path.join(__dirname) + '?outputStyle=compressed&testString=scss&prefix=images&manifest=rev-manifest&outputDir=' + path.join(__dirname, 'example', 'dist'),
'logger-loader': path.join(__dirname, 'logger-loader'),
'noop-loader': path.join(__dirname, 'noop-loader'),
'passthru-loader': path.join(__dirname, 'passthru-loader'),
'manifest-loader': path.join(__dirname, 'manifest-loader') + '?limit=10000&hash=sha512&digest=hex&relativeSplit=images/&prefix=example/images&manifest=rev-manifest&outputDir=' + path.join(__dirname, 'example', 'dist')
}
},
plugins: [
new CachePlugin(myCache),
new ProgressPlugin()
],
module: {
loaders: [
{
test: /\.scss$/,
loaders: [
'noop-loader'
]
}
, {
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'manifest-loader'
]
}
, {
test: /\.jsx$/,
loader: 'babel',
query: {
optional: ['es7.classProperties']
}
}]
},
bail: true,
cache: true,
watch: false,
debug: true
};