Skip to content

Instantly share code, notes, and snippets.

@firedfox
Created April 28, 2018 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firedfox/7addc9eef9f45ea450dcc5c2142e5607 to your computer and use it in GitHub Desktop.
Save firedfox/7addc9eef9f45ea450dcc5c2142e5607 to your computer and use it in GitHub Desktop.
webpack config
/**
* @file webpack配置文件
* @author wangyang02
*/
const webpack = require('webpack');
module.exports = {
entry: __dirname + '/src/index.js',
output: {
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(require('./package.json').version)
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment