-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
99 lines (92 loc) · 2.33 KB
/
webpack.config.js
File metadata and controls
99 lines (92 loc) · 2.33 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
var path = require('path');
var webpack = require('webpack');
//postcss
var cssnext = require('postcss-cssnext');
var precss = require('precss');
var autoreset = require('postcss-autoreset');
var reporter = require('postcss-reporter');
var lost = require('lost');
var sugarss = require('sugarss');
var initial = require('postcss-initial');
var postcssImport = require('postcss-import');
// styling
var magician = require('postcss-font-magician');
var center = require('postcss-center');
var position = require('postcss-position');
var size = require('postcss-size');
var MODULE_DERICTORIES = ['node_modules', 'lib'];
module.exports = {
devtool: '#inline-source-map',
entry: {
quiz: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
path.join(__dirname, 'src', 'quiz')
],
admin: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
path.join(__dirname, 'src', 'admin')
],
},
output: {
path: path.join(__dirname, '.public'),
filename: '[name].js',
publicPath: '/public/'
},
resolve: {
extensions: ['', '.js', '.jsx', '.json'],
modulesDirectories: MODULE_DERICTORIES,
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
module: {
noParse: [/.elm$/],
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components|src\/quiz)/,
loaders: ['react-hot', 'babel']
},
{
test: /\.elm$/,
loaders: ['elm-hot', 'elm-webpack?pathToMake=node_modules/.bin/elm-make']
},
{
test: /\.sass$/,
loaders: [
"style-loader",
"css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]",
"postcss-loader?parser=sugarss"
]
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.(jpe?g|png|gif|svg|eot|ttf|woff|woff2)$/i,
loader: 'url?limit=8192'
}
]
},
postcss: function (webpack) {
return [
postcssImport({
addDependencyTo: webpack,
path: MODULE_DERICTORIES
}),
/*autoreset({ all: initial }), */
lost,
cssnext,
precss,
magician,
center,
position,
size,
reporter({ clearMessages: true })
];
},
debug: true
};