const mix = require('laravel-mix');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Mix Asset Management
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Mix provides a clean, fluent API for defining some Webpack build steps
|
|
| for your Laravel application. By default, we are compiling the Sass
|
|
| file for the application as well as bundling up all the JS files.
|
|
|
|
|
*/
|
|
|
|
mix.options({
|
|
terser: {
|
|
extractComments: false
|
|
}
|
|
})
|
|
|
|
mix.webpackConfig({
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
filename: 'dist/index.html',
|
|
template: 'src/html/index.html.ejs',
|
|
inject: false,
|
|
title: 'Lessons Learned / Start',
|
|
content: '<a href="page-1.html">Page 1</a>',
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
filename: 'dist/page-1.html',
|
|
template: 'src/html/index.html.ejs',
|
|
inject: false,
|
|
title: 'Lessons Learned / Page 1',
|
|
content: '<a href="page-2.html">Page 2</a>',
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
filename: 'dist/page-2.html',
|
|
template: 'src/html/index.html.ejs',
|
|
inject: false,
|
|
title: 'Lessons Learned / 2',
|
|
content: '<a href="index.html">Start</a>',
|
|
})
|
|
]
|
|
})
|
|
|
|
mix
|
|
.js('src/js/index.js', 'dist/js')
|
|
.sass('src/scss/styles.scss', 'dist/css');
|