che-server/workspace-loader/webpack.prod.js

45 lines
1.5 KiB
JavaScript

/*******************************************************************************
* Copyright (c) 2018-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*******************************************************************************/
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = merge(common, {
devtool: 'source-map',
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}
],
},
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
new HtmlWebpackPlugin({
inject: false,
template: 'src/index.html',
title: 'Che Workspace Loader',
urlPrefix: '/workspace-loader/loader/',
cssName: 'style.css'
}),
new ExtractTextPlugin('style.css')
]
});