Skip to content

Commit

Permalink
Code splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonatan Kra committed Jan 2, 2019
1 parent eaf0f29 commit 89dd636
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
21 changes: 17 additions & 4 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const path = require('path');
const webpack = require('webpack');

const HtmlWebpackPlugin = require('html-webpack-plugin');

const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
'demo/index' : './src/demo/index.js',
index: './src/main.js',
'lib/ce-modal-window/index': './src/components/ce-modal-window/index.js'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'TDD Challenge',
meta: {
Expand All @@ -14,6 +17,16 @@ module.exports = {
],
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
// use the html loader
{
test: /\.html$/,
Expand Down
5 changes: 1 addition & 4 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ module.exports = merge(common, {
open: true,
contentBase: './dist'
},
mode: "development",
plugins: [
new CleanWebpackPlugin(['dist']),
]
mode: "development"
});
1 change: 0 additions & 1 deletion config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const merge = require('webpack-merge');
const common = require('./webpack.common');

Expand Down

0 comments on commit 89dd636

Please sign in to comment.