mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
添加cache-loader,debug模式下不再使用template缓存,修复一些 bug
This commit is contained in:
1 parent
dd7914e1fb
commit
11368bc831
21 files changed
+248
-266
No files matched your search
+20
-2
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user