snappymail/webpack.config.js

66 lines
1.5 KiB
JavaScript
Raw Normal View History

2015-11-19 01:32:29 +08:00
var
path = require('path'),
webpack = require('webpack')
;
2014-09-05 06:49:03 +08:00
module.exports = {
entry: {
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'),
2014-09-05 07:22:39 +08:00
new webpack.optimize.OccurenceOrderPlugin()
2014-09-05 06:49:03 +08:00
],
resolve: {
2015-11-19 01:32:29 +08:00
root: path.resolve(__dirname, 'dev'),
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: [
{
test: /\.jsx$/,
loader: 'babel',
exclude: /(node_modules|bower_components)/,
query: {
cacheDirectory: true,
2015-11-19 01:32:29 +08:00
// plugins: ['transform-runtime'],
2016-02-25 02:10:09 +08:00
presets: ['es2015-loose', 'stage-0']
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',
'$LAB': 'window.$LAB',
'progressJs': 'window.rainloopProgressJs',
'queue': 'window.queue',
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._',
'Q': 'window.Q',
2015-01-06 04:55:06 +08:00
'$': 'window.jQuery'
2014-09-05 06:49:03 +08:00
}
};