1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00
copilot/ui/webpack/development.js

40 lines
925 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 path = require('path');
2016-10-23 07:27:18 +03:00
const devServer = {
contentBase: [
path.join(__dirname, '../static/')
],
2016-10-23 07:27:18 +03:00
hot: true,
compress: true,
lazy: false,
historyApiFallback: {
index: './index.html'
2016-10-23 07:27:18 +03:00
}
};
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
});