add new packages and finish webpack config

pull/9/head
unknown 2018-10-28 18:12:33 -04:00
parent cd60b8b290
commit 25b191d04c
2 changed files with 13 additions and 5 deletions

View File

@ -29,13 +29,15 @@
"html-webpack-plugin": "^3.2.0",
"npm-run-all": "^4.1.3",
"rimraf": "^2.6.2",
"sass-webpack-plugin": "^1.0.3",
"webpack": "^4.23.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
},
"scripts": {
"start": "npm-run-all --parallel open:client lift",
"start": "npm run open:client",
"start:debug": "npm-run-all --parallel open:client debug",
"start:prod": "npm-run-all --parallel build:prod lift",
"open:client": "webpack-dev-server --mode development",
"build": "npm run build:prod",
"build:dev": "webpack --mode development",

View File

@ -1,11 +1,14 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const SassWebpackPlugin = require('sass-webpack-plugin')
const path = require('path')
module.exports = {
mode: process.env.NODE_ENV || 'development',
entry: {
login: './assets/js/login.js'
},
output: {
path: __dirname + '/.tmp/public',
path: path.join(__dirname, '/.tmp/public'),
filename: '[name].bundle.js'
},
module: {
@ -23,7 +26,10 @@ module.exports = {
},
plugins: [
new HtmlWebpackPlugin({
template: 'assets/templates/login.html'
})
template: 'assets/templates/login.html',
links: [{ rel: 'stylesheet', type: 'text/css', href: 'login.css' }],
filename: path.join(__dirname, '/.tmp/public/login.html')
}),
new SassWebpackPlugin(['assets/styles/login.scss'], process.env.NODE_ENV),
]
};