12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- var path = require('path')
- var webpack = require('webpack')
- module.exports = {
- entry: ['./lofig.js'],
- output: {
- path: path.resolve(__dirname, './dist'),
- publicPath: '/dist',
- filename: 'lofig.min.js',
- },
- resolve: {
- alias: {
- modules: path.join(__dirname, 'node_modules')
- }
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: ['@babel/preset-env']
- }
- }
- }
- ]
- },
- devServer: {
- historyApiFallback: true,
- noInfo: true
- },
- devtool: '#eval-source-map'
- }
- if (process.env.NODE_ENV === 'production') {
- module.exports.devtool = '#source-map'
- module.exports.plugins = (module.exports.plugins || []).concat([
- new webpack.DefinePlugin({
- 'process.env': {
- NODE_ENV: '"production"'
- }
- }),
- new webpack.optimize.UglifyJsPlugin({
- compress: {
- warnings: false
- }
- }),
- new webpack.optimize.OccurenceOrderPlugin()
- ])
- }
|