joyent-portal/ui/webpack/development.js

37 lines
867 B
JavaScript
Raw Normal View History

2016-10-25 22:36:05 +03:00
const pkg = require('../package.json');
2016-10-24 16:13:02 +03:00
const base = require('./base.js');
2016-10-23 07:27:18 +03:00
const webpack = require('webpack');
const devServer = {
hot: true,
compress: true,
lazy: false,
publicPath: '/static/',
historyApiFallback: {
index: './static/index.html'
}
};
2016-10-24 16:13:02 +03:00
module.exports = Object.assign(base.config, {
2016-10-26 19:31:55 +03:00
entry: {
docs: [
2016-10-23 07:27:18 +03:00
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
2016-10-26 19:31:55 +03:00
'./docs/index.js'
]
},
2016-10-24 16:13:02 +03:00
plugins: base.config.plugins.concat([
2016-10-25 22:36:05 +03:00
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
APP_NAME: JSON.stringify(pkg.name),
APP_VERSION: JSON.stringify(pkg.version)
}
})
2016-10-23 07:27:18 +03:00
]),
devtool: 'source-map',
devServer
});