2018-10-10 08:06:23 +00:00
|
|
|
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2018-10-14 10:06:25 +00:00
|
|
|
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
2018-10-10 08:06:23 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './app/__module.js',
|
|
|
|
output: {
|
|
|
|
filename: 'main.js',
|
|
|
|
path: path.resolve(__dirname, 'dist/public')
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: [
|
2018-10-14 05:21:10 +00:00
|
|
|
'auto-ngtemplate-loader',
|
|
|
|
{
|
|
|
|
// enforce: 'pre',
|
|
|
|
loader: 'eslint-loader'
|
|
|
|
}
|
2018-10-10 08:06:23 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
|
|
|
exclude: path.resolve(__dirname, './app/index.html'),
|
|
|
|
use: [
|
|
|
|
{ loader: 'ngtemplate-loader', options: { relativeTo: __dirname } },
|
|
|
|
{ loader: 'html-loader' }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff|woff2|eot|ttf|svg)$/,
|
|
|
|
loader: 'url-loader?limit=100000'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'file-loader'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: ['style-loader', 'css-loader?sourceMap']
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
mode: 'development',
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './app/index.html'
|
2018-10-14 10:06:25 +00:00
|
|
|
}),
|
|
|
|
new WebpackBuildNotifierPlugin({
|
|
|
|
title: "My Project Webpack Build",
|
|
|
|
logo: path.resolve("./assets/favicon-32x32.png"),
|
|
|
|
suppressSuccess: true
|
|
|
|
})
|
2018-10-10 08:06:23 +00:00
|
|
|
]
|
|
|
|
};
|