2017-10-01 13:02:25 -05:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const merge = require('webpack-merge');
|
|
|
|
const common = require('./webpack.common.js');
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
|
|
const WebpackCleanupPlugin = require('webpack-cleanup-plugin');
|
|
|
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
|
|
|
|
|
|
module.exports = merge(common, {
|
2017-10-11 09:07:10 -05:00
|
|
|
devtool: "cheap-module-source-map",
|
2017-10-01 13:02:25 -05:00
|
|
|
|
|
|
|
entry: {
|
|
|
|
dark: './public/sass/grafana.dark.scss',
|
|
|
|
light: './public/sass/grafana.light.scss',
|
2017-10-03 04:02:40 -05:00
|
|
|
vendor: require('./dependencies'),
|
2017-10-01 13:02:25 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
require('./sass.rule.js')({
|
2017-11-01 08:23:46 -05:00
|
|
|
sourceMap: false, minimize: false
|
2017-10-01 13:02:25 -05:00
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new ExtractTextPlugin({ // define where to save the file
|
|
|
|
filename: 'grafana.[name].css',
|
2017-11-01 08:23:46 -05:00
|
|
|
allChunks: true,
|
2017-10-01 13:02:25 -05:00
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
filename: path.resolve(__dirname, '../../public/views/index.html'),
|
|
|
|
template: path.resolve(__dirname, '../../public/views/index.template.html'),
|
|
|
|
inject: 'body',
|
|
|
|
chunks: ['manifest', 'vendor', 'app'],
|
|
|
|
}),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
'NODE_ENV': JSON.stringify('development')
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
|
names: ['vendor', 'manifest'],
|
|
|
|
}),
|
2017-10-03 05:18:22 -05:00
|
|
|
// new BundleAnalyzerPlugin({
|
|
|
|
// analyzerPort: 8889
|
|
|
|
// })
|
2017-10-01 13:02:25 -05:00
|
|
|
]
|
|
|
|
});
|