cschweda-webpack-template
Version:
This is a fork of the excellent html-webpack-template with some minor deletions and additions.
69 lines (67 loc) • 1.58 kB
JavaScript
var path = require('path')
var HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: ['./index'],
output: {
path: __dirname + '/dist',
filename: 'main.js'
},
resolveLoader: { root: path.join(__dirname, 'node_modules') },
module: {
loaders: [{ test: /\.js$/, loader: 'babel-loader' }]
},
devServer: {
port: 8080
},
plugins: [
new HtmlWebpackPlugin({
inject: false,
template: '../index.ejs',
appMountId: 'app',
devServer: 'http://localhost:8080',
meta: [
{
name: 'description',
content: 'A better default template for html-webpack-plugin.'
}
],
mobile: true,
lang: 'en-US',
links: [
'https://fonts.googleapis.com/css?family=Roboto',
{
href: '/apple-touch-icon.png',
rel: 'apple-touch-icon',
sizes: '180x180'
},
{
href: '/favicon-32x32.png',
rel: 'icon',
sizes: '32x32',
type: 'image/png'
}
],
scripts: [
'http://example.com/somescript.js',
{
src: '/myModule.js',
type: 'module'
}
],
postscripts: [
'http://example.com/my-postsomescript.js',
],
title: 'My App',
buildInfo: [{
Build: new Date(),
GitHub: 'https://github.com/cschweda/cschweda-webpack-template',
Contact: 'test@test.com'
}],
window: {
env: {
apiHost: 'http://myapi.com/api/v1'
}
}
})
]
}