-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
71 lines (68 loc) · 1.9 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
68
69
70
71
var reworkLoader = require('rework-webpack-loader');
var reworkVars = require('rework-vars');
var reworkCalc = require('rework-calc');
var reworkCustomMedia = require('rework-custom-media');
var path = require('path');
var webpack = require('webpack');
var varMap = reworkLoader.makeVarMap('src/theme/theme.css');
module.exports = {
entry: '../index',
target: 'web',
context: path.join(__dirname, 'src'),
debug: 'source-map',
output: {
path: path.join(__dirname, 'public'),
publicPath: '/',
sourceMapFilename: '[file].map',
filename: 'app.js',
chunkFilename: '[chunkhash].js'
},
resolve: {
packageMains: [
'webpack',
'browser',
'web',
'browserify',
['jam', 'main'],
'style',
'main'
],
moduleDirectories: ['node_modules'],
extensions: ['', '.webpack.js', '.web.js', '.js', '.coffee', '.cjsx', '.jsx'],
root: [
path.join(__dirname, 'src'),
path.join(__dirname, 'node_modules')
],
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
module: {
loaders: [
{ test: /\.jsx$/, loader: 'jsx-loader' },
{ test: /\.coffee$/, loader: 'coffee-loader'},
{ test: /\.cjsx$/, loader: 'coffee-loader!cjsx-loader' },
{ test: /\.css$/, loader: 'style-loader!rework-webpack-loader' },
{
test: /\.scss$/,
// Query parameters are passed to node-sass
loader: "style!css!sass?outputStyle=expanded&" +
"includePaths[]=" +
(path.resolve(__dirname, "./bower_components")) + "&" +
"includePaths[]=" +
(path.resolve(__dirname, "./node_modules"))
}
],
noParse: /\.min\.js/
},
rework: {
use: [
reworkLoader.plugins.imports,
reworkLoader.plugins.urls,
reworkLoader.plugins.stripLocalDefs(varMap),
reworkCustomMedia({map: varMap}),
reworkVars({map: varMap}),
reworkCalc
]
}
}