hw-weapp-compiler 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/dev.js +2 -19
  2. package/package.json +1 -1
package/build/dev.js CHANGED
@@ -1,11 +1,11 @@
1
- const path = require('path');
2
1
  const webpack = require('webpack');
3
2
  const { ENV } = require('./config/constants');
4
3
  const webpackConfig = require('./webpack.config');
5
4
  const { createCompilerHandler } = require('./utils/createCompilerHandler');
6
5
 
7
6
  module.exports = async (opts) => {
8
- // dev 同样启用 filesystem cache,watch 重建复用缓存,二次启动显著提速
7
+ // 开发环境禁用 filesystem cache,避免 output.clean 后复用旧缓存导致副作用产物漏生成。
8
+ // watch 进程内仍保留 webpack 的增量编译能力。
9
9
  const compiler = webpack(
10
10
  await webpackConfig(
11
11
  {
@@ -16,23 +16,6 @@ module.exports = async (opts) => {
16
16
  keep: /^(project\.config\.json|weapp\.env\.json)$/,
17
17
  },
18
18
  },
19
- cache: {
20
- type: 'filesystem',
21
- cacheDirectory: path.resolve(process.cwd(), 'node_modules/.cache/webpack'),
22
- buildDependencies: {
23
- // webpack.config.js 及其 require 的 getEntries.js / loader / plugin 都作为
24
- // 缓存依赖,本编译器自身代码改动后即时整体失效,避免复用旧 loader 输出。
25
- config: [
26
- path.resolve(__dirname, 'webpack.config.js'),
27
- path.resolve(__dirname, 'config/getEntries.js'),
28
- path.resolve(__dirname, 'plugin/index.js'),
29
- path.resolve(__dirname, 'loader/js-loader.js'),
30
- path.resolve(__dirname, 'loader/wxs-loader.js'),
31
- path.resolve(__dirname, 'loader/wxml-loader.js'),
32
- ],
33
- },
34
- name: `dev-${process.version.slice(0, 6)}`,
35
- },
36
19
  },
37
20
  opts || {},
38
21
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hw-weapp-compiler",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "基于 webpack5 的小程序构建工具,兼容 Node.js 14~24",
5
5
  "main": "index.js",
6
6
  "bin": {