2017-04-11 09:11:09 +10:00
|
|
|
var path = require('path');
|
2017-04-11 09:15:51 +10:00
|
|
|
// Require WebpackAutoInject from npm installed modules ( preferred )
|
2017-04-13 08:40:22 +10:00
|
|
|
// var WebpackAutoInject = require('webpack-auto-inject-version');
|
2017-04-11 09:11:09 +10:00
|
|
|
// Require WebpackAutoInject from dist - dev purpose only ( do not use the below line )
|
2017-04-13 08:40:22 +10:00
|
|
|
var WebpackAutoInject = require('../dist/WebpackAutoInjectVersion');
|
2017-04-11 09:11:09 +10:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2017-04-13 08:40:22 +10:00
|
|
|
index: ['./src/main.js']
|
2017-04-11 09:11:09 +10:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.js', '.html']
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: '[name]-bundle.js',
|
|
|
|
path: path.resolve(process.cwd(), 'dist')
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
include: [
|
|
|
|
path.resolve('src')
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.txt$/,
|
|
|
|
loader: 'raw-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
|
|
|
loader: 'raw-loader!html-minify-loader'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new WebpackAutoInject({
|
2017-04-12 19:08:41 +10:00
|
|
|
PACKAGE_JSON_PATH: './package.json',
|
2017-04-11 09:11:09 +10:00
|
|
|
components: {
|
|
|
|
AutoIncreaseVersion: true,
|
|
|
|
InjectAsComment: true,
|
|
|
|
InjectByTag: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|