snappymail/webpack.config.js

74 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-11-19 01:32:29 +08:00
var
path = require('path'),
2016-05-26 06:38:32 +08:00
webpack = require('webpack'),
jsLoaderQuery = {
cacheDirectory: true,
presets: ['es2015-loose-native-modules', 'stage-0']
}
2015-11-19 01:32:29 +08:00
;
2014-09-05 06:49:03 +08:00
module.exports = {
entry: {
2016-05-06 23:14:40 +08:00
'boot': __dirname + '/dev/boot.jsx',
2015-11-19 01:32:29 +08:00
'app': __dirname + '/dev/app.jsx',
'admin': __dirname + '/dev/admin.jsx'
2014-09-05 06:49:03 +08:00
},
output: {
pathinfo: true,
path: __dirname + '/rainloop/v/0.0.0/static/js/',
filename: '[name].js',
publicPath: 'rainloop/v/0.0.0/static/js/',
chunkFilename: '[chunkhash].subapp.js'
2014-09-05 06:49:03 +08:00
},
// devtool: "#source-map",
2014-09-05 06:49:03 +08:00
plugins: [
2014-10-29 06:05:50 +08:00
// new webpack.optimize.CommonsChunkPlugin('common.js'),
2016-05-26 06:38:32 +08:00
new webpack.optimize.OccurrenceOrderPlugin()
2014-09-05 06:49:03 +08:00
],
resolve: {
2016-05-26 06:38:32 +08:00
modules: [path.resolve(__dirname, 'dev'), 'node_modules'],
2015-11-15 08:23:16 +08:00
extensions: ['', '.js', '.jsx'],
2014-09-05 06:49:03 +08:00
alias: {
2015-11-15 08:23:16 +08:00
'Opentip': __dirname + '/dev/External/Opentip.js',
'ko': __dirname + '/dev/External/ko.js'
2014-09-05 06:49:03 +08:00
}
},
2015-11-15 08:23:16 +08:00
module: {
loaders: [
2016-05-20 08:04:15 +08:00
{
2016-05-24 05:56:48 +08:00
test: /\.(html|css)$/,
2016-05-20 08:04:15 +08:00
loader: 'raw'
},
2016-05-21 06:46:56 +08:00
{
2016-05-26 06:38:32 +08:00
test: /\.(json)$/,
loader: 'json'
2016-05-21 06:46:56 +08:00
},
2015-11-15 08:23:16 +08:00
{
test: /\.jsx$/,
loader: 'babel',
exclude: /(node_modules|bower_components)/,
2016-05-26 06:38:32 +08:00
query: jsLoaderQuery
2015-11-15 08:23:16 +08:00
}
]
},
2014-09-05 06:49:03 +08:00
externals: {
'window': 'window',
2015-01-06 04:55:06 +08:00
'JSON': 'window.JSON',
2014-09-19 23:24:38 +08:00
'JSEncrypt': 'window.JSEncrypt',
2016-05-20 08:04:15 +08:00
'progressJs': 'window.progressJs',
2015-01-06 04:55:06 +08:00
'moment': 'window.moment',
'ifvisible': 'window.ifvisible',
'crossroads': 'window.crossroads',
'hasher': 'window.hasher',
'Jua': 'window.Jua',
'Autolinker': 'window.Autolinker',
'Tinycon': 'window.Tinycon',
2015-01-06 04:55:06 +08:00
'ssm': 'window.ssm',
'key': 'window.key',
'_': 'window._',
'qr': 'window.qr',
2016-05-24 01:33:01 +08:00
'Promise': 'window.Promise',
2015-01-06 04:55:06 +08:00
'$': 'window.jQuery'
2014-09-05 06:49:03 +08:00
}
};