添加cache-loader,debug模式下不再使用template缓存,修复一些 bug

This commit is contained in:
undefined committed 2020-07-11 20:00:43 +08:00
1 parent dd7914e1fb
commit 11368bc831
21 files changed
+248 -266

No files matched your search

+20 -2
View File
@@ -1,4 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path');
const webpack = require('webpack');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const { root } = require('./utils');
@@ -7,14 +8,31 @@ const build = async (type) => {
const config = {
mode: type,
entry: {
app: root('dist/loader.js'),
app: root('hydro/loader.ts'),
},
output: {
filename: '[name].js',
path: root('.build'),
},
target: 'node',
module: {},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'cache-loader',
options: {
cacheDirectory: path.resolve(__dirname, '..', '.cache', 'ts'),
},
},
'ts-loader',
],
},
],
},
resolve: { extensions: ['.js', '.ts'] },
plugins: [
new webpack.ProgressPlugin(),
new FriendlyErrorsPlugin({