-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
56 lines (55 loc) · 1.34 KB
/
webpack.config.babel.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
import webpack from 'webpack'
import path from 'path'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import precss from 'precss'
import importGlobLoader from 'import-glob-loader'
import config from './config'
module.exports = [{
entry: path.join(__dirname, config.source.javascript.path + config.source.javascript.fileName),
output: {
path: path.join(__dirname, config.build.javascript.path),
filename: config.build.javascript.fileName
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),
new webpack.optimize.UglifyJsPlugin()
],
externals: {
jquery: 'window.jQuery'
}
}, {
entry: path.join(__dirname, config.source.stylesheet.path + config.source.stylesheet.fileName),
output: {
path: path.join(__dirname, config.build.stylesheet.path),
filename: config.build.stylesheet.fileName
},
resolve: {
extensions: ['', '.css']
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css!postcss!import-glob')
}
]
},
plugins: [
new ExtractTextPlugin(config.build.stylesheet.fileName)
]
}];