mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-17 06:46:05 +01:00
wip
This commit is contained in:
@@ -1,24 +1,32 @@
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const { AngularWebpackPlugin } = require('@ngtools/webpack')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
|
||||
const htmlPluginOptions = {
|
||||
hash: true,
|
||||
minify: false
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
entry: {
|
||||
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './src/index.pug'),
|
||||
index: path.resolve(__dirname, 'src/index.ts'),
|
||||
'terminal.ignore': 'file-loader?name=terminal.html!pug-html-loader!' + path.resolve(__dirname, './src/terminal.pug'),
|
||||
terminal: path.resolve(__dirname, 'src/terminal.ts'),
|
||||
},
|
||||
mode: process.env.DEV ? 'development' : 'production',
|
||||
context: __dirname,
|
||||
devtool: 'cheap-module-source-map',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
path: path.join(__dirname, 'build'),
|
||||
pathinfo: true,
|
||||
publicPath: '/static/',
|
||||
filename: '[name].js',
|
||||
chunkFilename: '[name].bundle.js',
|
||||
},
|
||||
cache: !process.env.DEV ? false : {
|
||||
type: 'filesystem',
|
||||
},
|
||||
resolve: {
|
||||
modules: [
|
||||
'src/',
|
||||
@@ -56,7 +64,11 @@ module.exports = {
|
||||
{
|
||||
test: /\.(jpeg|png|svg)?$/,
|
||||
type: 'asset/resource',
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -65,5 +77,17 @@ module.exports = {
|
||||
tsconfig: 'tsconfig.main.json',
|
||||
directTemplateLoading: false,
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/index.html',
|
||||
filename: 'index.html',
|
||||
chunks: ['index'],
|
||||
...htmlPluginOptions,
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/terminal.html',
|
||||
filename: 'terminal.html',
|
||||
chunks: ['terminal'],
|
||||
...htmlPluginOptions,
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user