Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var path = require('path');
- var webpack = require('webpack');
- var settings = {
- devtool: 'eval-source-map',
- watch: true,
- entry: {
- app: 'app',
- },
- output: {
- path: path.join(__dirname, '../Umbraco.Site/Scripts'),
- filename: '[name].js'
- },
- module: {
- rules: [
- {
- test: /\.jsx?$/,
- exclude: /node_modules/,
- loader: 'babel-loader',
- options: {
- presets: [
- ['env', { 'modules': false }]
- ]
- },
- }
- ]
- },
- plugins: [
- ],
- resolve: {
- modules: [
- path.resolve(__dirname + '/js'),
- 'node_modules',
- ],
- extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js", '.jsx'],
- alias: {
- }
- }
- };
- module.exports = function(env) {
- if (env && env.prod) {
- settings = Object.assign(settings, {
- devtool: '',
- output: {
- path: path.join(__dirname, '../Umbraco.Site/scripts'),
- filename: '[name].min.js'
- },
- plugins: [
- new webpack.DefinePlugin({
- 'process.env': {
- // This has effect on the react lib size
- 'NODE_ENV': JSON.stringify('production'),
- }
- }),
- new webpack.optimize.UglifyJsPlugin({})
- ]
- });
- }
- return settings;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement