Open ripper2hl opened 6 years ago
Finally my webpack.conf.js
, i try make an merge request for this
const webpack = require('webpack');
const conf = require('./gulp.conf');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FailPlugin = require('webpack-fail-plugin');
const autoprefixer = require('autoprefixer');
module.exports = {
mode : 'development',
module: {
rules: [
{
test: /\.json$/,
use: [
'json-loader'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: 'eslint-loader',
enforce: 'pre'
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{ loader: 'postcss-loader', options : { plugins: () => [autoprefixer] } }
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [
'ng-annotate-loader',
'babel-loader'
]
},
{
test: /\.html$/,
use: [
'html-loader'
]
}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
FailPlugin,
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
})
],
devtool: 'source-map',
output: {
path: path.join(process.cwd(), conf.paths.tmp),
filename: 'index.js'
},
entry: `./${conf.path.src('index')}`
};
Fresh instalation all dependencies need upgrade, and for example webpack 4 is out and need some changes in webpack.conf.js
https://javascriptplayground.com/moving-to-webpack-2/