Skip to content

Commit

Permalink
build(webpack): setup webpack default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Jul 5, 2019
1 parent e184387 commit 09ada09
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict'

const devMode = process.env.NODE_ENV !== 'production'
const path = require('path')

module.exports = {
mode: devMode ? 'development' : 'production',
entry: path.resolve(__dirname, 'src/index.js'),
output: {
library: 'ecomUtils',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: 'ecom-utils.min.js'
},
devServer: {
contentBase: path.resolve(__dirname, 'test'),
compress: true,
port: 9315,
open: true
},
module: {
rules: [{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
}]
},
stats: {
colors: true
},
devtool: 'source-map'
}

0 comments on commit 09ada09

Please sign in to comment.