nmdc-webfrontend/webpack.config.js

57 lines
1.2 KiB
JavaScript

/*! webpack.config.js */
const webpack = require("webpack");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanCSSPlugin = require("less-plugin-clean-css");
const ScriptExtHtmlWebpackPlugin = require("script-ext-html-webpack-plugin");
module.exports = {
entry: "./client/dcwebui.js",
output: {
path: __dirname,
filename: "clientpack/bundle.min.js"
},
module: {
loaders: [
// Plain CSS files (no longer present)
{ test: /\.css$/, loader: "style-loader!css-loader" },
// LESS CSS files
{
test: /\.less$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{
loader: "less-loader",
options: {
noIeCompat: false,
plugins: [
new CleanCSSPlugin({ advanced: true })
]
}
}
]
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: true
}
}),
new HtmlWebpackPlugin({
template: './client/index.htm',
filename: 'output.html',
//filename: './clientpack/index.htm',
minify: {},
}),
new ScriptExtHtmlWebpackPlugin({
inline: [ /\.*/ ]
})
]
};