-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
76 lines (71 loc) · 2.02 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
72
73
74
75
76
/***** WARNING: ES5 code only here. Not transpiled! *****/
/**
* External dependencies
*/
var webpack = require ('webpack');
var path = require('path');
var WebpackNotifierPlugin = require('webpack-notifier');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
/**
* Internal dependencies
*/
/**
* Internal variables
*/
webpackConfig = {
/*entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist/'),
filename: 'build.js'
},*/
entry: {
lite: "./app.js",
},
node: {
__filename: true,
__dirname: true
},
output: { filename: "dist/[name].js" },
plugins: [
new webpack.optimize.CommonsChunkPlugin("dist/init.js"),
new WebpackNotifierPlugin({alwaysNotify: true, title: 'Webpack'}),
// new CopyFromDistToCf7Js(),
],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
// include: __dirname + '/src',
include: path.join(__dirname, '/src'),
loader: 'babel-loader',
query: {
plugins: ['transform-decorators-legacy' ],
presets: ['react','es2015', 'stage-0']
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules')
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.less$/,
loader: "style!css!less"
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
}
// { test: /\.css$/, loader: "style-loader!css-loader" },
]
}
};
module.exports = webpackConfig;