xhs-mp-pack 2.0.19 → 2.0.20-beta.0
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.
- package/dist/MPPack.d.ts +1 -0
- package/dist/MPPack.js +64 -9
- package/dist/base/errors/ParserError.js +12 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/package.json +4 -4
package/dist/MPPack.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import MPPackSetting from '@/MPPackSetting';
|
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import { ICompileOptions } from './types';
|
|
7
7
|
import Watching from './Watching';
|
|
8
|
+
export declare const watchIgnored: string[];
|
|
8
9
|
export declare abstract class AbstractMPPack extends EventEmitter {
|
|
9
10
|
abstract hooks: any;
|
|
10
11
|
abstract watch(config: any, callback?: any): any;
|
package/dist/MPPack.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MPPack = exports.AbstractMPPack = void 0;
|
|
6
|
+
exports.MPPack = exports.AbstractMPPack = exports.watchIgnored = void 0;
|
|
7
7
|
require("module-alias");
|
|
8
8
|
const xhs_mp_project_1 = require("xhs-mp-project");
|
|
9
9
|
const ProgressPlugin_1 = __importDefault(require("@/plugins/ProgressPlugin"));
|
|
@@ -23,17 +23,72 @@ const NodeWatchFileSystem_1 = __importDefault(require("@/base/NodeWatchFileSyste
|
|
|
23
23
|
const types_1 = require("./types");
|
|
24
24
|
const normalization_1 = require("./base/normalization");
|
|
25
25
|
const setupWriteToDisk_1 = __importDefault(require("./setupWriteToDisk"));
|
|
26
|
+
exports.watchIgnored = [
|
|
27
|
+
'**/node_modules',
|
|
28
|
+
'project.config.json',
|
|
29
|
+
'project.private.config.json',
|
|
30
|
+
'**/.git',
|
|
31
|
+
'**/.DS_Store',
|
|
32
|
+
'**/Thumbs.db',
|
|
33
|
+
'**/.vscode',
|
|
34
|
+
'**/.idea',
|
|
35
|
+
'**/.vs',
|
|
36
|
+
'**/.xhs-ide',
|
|
37
|
+
'.gitignore',
|
|
38
|
+
'.npmignore',
|
|
39
|
+
'.npmrc',
|
|
40
|
+
'.eslintrc.js',
|
|
41
|
+
'.eslintrc.json',
|
|
42
|
+
'.eslintrc.yaml',
|
|
43
|
+
'.eslintrc.yml',
|
|
44
|
+
'.eslintrc',
|
|
45
|
+
'.prettierignore',
|
|
46
|
+
'.prettierrc.js',
|
|
47
|
+
'.prettierrc.json',
|
|
48
|
+
'.prettierrc.yaml',
|
|
49
|
+
'.prettierrc.yml',
|
|
50
|
+
'.prettierrc',
|
|
51
|
+
'.stylelintrc.js',
|
|
52
|
+
'.stylelintrc.json',
|
|
53
|
+
'.stylelintrc.yaml',
|
|
54
|
+
'.stylelintrc.yml',
|
|
55
|
+
'.stylelintrc',
|
|
56
|
+
'.babelrc.js',
|
|
57
|
+
'.babelrc.json',
|
|
58
|
+
'.babelrc.yaml',
|
|
59
|
+
'.babelrc.yml',
|
|
60
|
+
'.babelrc',
|
|
61
|
+
'.browserslistrc',
|
|
62
|
+
'.editorconfig',
|
|
63
|
+
'.env',
|
|
64
|
+
'.env.local',
|
|
65
|
+
'.env.development',
|
|
66
|
+
'.env.development.local',
|
|
67
|
+
'.env.test',
|
|
68
|
+
'.env.test.local',
|
|
69
|
+
'.env.production',
|
|
70
|
+
'.env.production.local',
|
|
71
|
+
'.env.staging',
|
|
72
|
+
'.env.staging.local',
|
|
73
|
+
'.env.pre',
|
|
74
|
+
'.env.pre.local',
|
|
75
|
+
'.env.prod',
|
|
76
|
+
'.env.prod.local',
|
|
77
|
+
'.env.stg',
|
|
78
|
+
'.gitlab-ci.yml',
|
|
79
|
+
'package.json',
|
|
80
|
+
'package-lock.json',
|
|
81
|
+
'yarn.lock',
|
|
82
|
+
'**/readme.md',
|
|
83
|
+
'**/README.md',
|
|
84
|
+
'**/README.zh-CN.md',
|
|
85
|
+
'**/README.en-US.md',
|
|
86
|
+
'**/README.zh-TW.md',
|
|
87
|
+
];
|
|
26
88
|
const watchOptions = {
|
|
27
89
|
aggregateTimeout: 300,
|
|
28
90
|
poll: false,
|
|
29
|
-
ignored:
|
|
30
|
-
'**/node_modules',
|
|
31
|
-
'project.config.json',
|
|
32
|
-
'project.private.config.json',
|
|
33
|
-
'**/.git',
|
|
34
|
-
'**/.DS_Store',
|
|
35
|
-
'**/Thumbs.db'
|
|
36
|
-
]
|
|
91
|
+
ignored: exports.watchIgnored
|
|
37
92
|
};
|
|
38
93
|
const { BUILD_REASON } = const_1.default;
|
|
39
94
|
class AbstractMPPack extends events_1.EventEmitter {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.initErrorContext = exports.ParserError = exports.index2ColRow = void 0;
|
|
7
7
|
const registerInternalSerializer_1 = __importDefault(require("@/serialization/registerInternalSerializer"));
|
|
8
8
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const xhs_mp_compiler_utils_1 = require("xhs-mp-compiler-utils");
|
|
9
10
|
function md5(str) {
|
|
10
11
|
return crypto_1.default.createHash('md5').update(str).digest('hex');
|
|
11
12
|
}
|
|
@@ -46,7 +47,7 @@ const formatLineNumber = (a, max = 3) => {
|
|
|
46
47
|
class ParserError extends Error {
|
|
47
48
|
constructor(index = 0, // 错误位置
|
|
48
49
|
message$, // 错误信息
|
|
49
|
-
prefix = '
|
|
50
|
+
prefix = '文件编译错误') {
|
|
50
51
|
super('');
|
|
51
52
|
this.index = index;
|
|
52
53
|
this.message$ = message$;
|
|
@@ -93,14 +94,16 @@ class ParserError extends Error {
|
|
|
93
94
|
getLine(row + 1),
|
|
94
95
|
getLine(row + 2)
|
|
95
96
|
].filter(Boolean);
|
|
96
|
-
//
|
|
97
|
-
this.message =
|
|
98
|
-
'
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
// 用于ide提取错误或者警告
|
|
98
|
+
this.message = (0, xhs_mp_compiler_utils_1.getIDEMessage)({
|
|
99
|
+
type: 'error',
|
|
100
|
+
prefix: this.prefix,
|
|
101
|
+
message: this.message$,
|
|
102
|
+
errorLines: showErrLines,
|
|
103
|
+
file: currentresourcePath,
|
|
104
|
+
line: row,
|
|
105
|
+
column: col
|
|
106
|
+
});
|
|
104
107
|
this.stack = undefined;
|
|
105
108
|
}
|
|
106
109
|
serialize({ write }) {
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import SourceMapDevToolPlugin from '@/sourcemap/SourceMapDevToolPlugin';
|
|
|
21
21
|
import CONSTANTS from './base/const';
|
|
22
22
|
export * from './types';
|
|
23
23
|
export { RawSource, ConcatSource } from 'webpack-sources';
|
|
24
|
-
import { AbstractMPPack, MPPack } from './MPPack';
|
|
24
|
+
import { AbstractMPPack, MPPack, watchIgnored } from './MPPack';
|
|
25
25
|
import MPPackSetting from './MPPackSetting';
|
|
26
26
|
declare const utils: {
|
|
27
27
|
createHash: (algorithm: string | typeof import("./base/Hash").default | undefined) => any;
|
|
@@ -29,5 +29,5 @@ declare const utils: {
|
|
|
29
29
|
stat: typeof stat;
|
|
30
30
|
throttleAll: typeof throttleAll;
|
|
31
31
|
};
|
|
32
|
-
export { Config, Resolver, CONSTANTS, BaseError, utils, CopyPatterns, Compilation, AbstractMPPack, MPPack, MPPackSetting, MultiCompiler, Compiler, MultiStats, Stats, ParserError, index2ColRow, initErrorContext };
|
|
32
|
+
export { watchIgnored, Config, Resolver, CONSTANTS, BaseError, utils, CopyPatterns, Compilation, AbstractMPPack, MPPack, MPPackSetting, MultiCompiler, Compiler, MultiStats, Stats, ParserError, index2ColRow, initErrorContext };
|
|
33
33
|
export { DefinePlugin, CssMinimizerPlugin, MiniCssExtractPlugin, BuildInfoPlugin, ProgressPlugin, EvalSourceMapDevToolPlugin, SourceMapDevToolPlugin };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.SourceMapDevToolPlugin = exports.EvalSourceMapDevToolPlugin = exports.ProgressPlugin = exports.BuildInfoPlugin = exports.MiniCssExtractPlugin = exports.CssMinimizerPlugin = exports.DefinePlugin = exports.initErrorContext = exports.index2ColRow = exports.ParserError = exports.Stats = exports.MultiStats = exports.Compiler = exports.MultiCompiler = exports.MPPackSetting = exports.MPPack = exports.AbstractMPPack = exports.Compilation = exports.CopyPatterns = exports.utils = exports.BaseError = exports.CONSTANTS = exports.Resolver = exports.Config = exports.ConcatSource = exports.RawSource = void 0;
|
|
20
|
+
exports.SourceMapDevToolPlugin = exports.EvalSourceMapDevToolPlugin = exports.ProgressPlugin = exports.BuildInfoPlugin = exports.MiniCssExtractPlugin = exports.CssMinimizerPlugin = exports.DefinePlugin = exports.initErrorContext = exports.index2ColRow = exports.ParserError = exports.Stats = exports.MultiStats = exports.Compiler = exports.MultiCompiler = exports.MPPackSetting = exports.MPPack = exports.AbstractMPPack = exports.Compilation = exports.CopyPatterns = exports.utils = exports.BaseError = exports.CONSTANTS = exports.Resolver = exports.Config = exports.watchIgnored = exports.ConcatSource = exports.RawSource = void 0;
|
|
21
21
|
require("./base/moduleAlias");
|
|
22
22
|
const webpack_chain_1 = __importDefault(require("webpack-chain"));
|
|
23
23
|
exports.Config = webpack_chain_1.default;
|
|
@@ -67,6 +67,7 @@ Object.defineProperty(exports, "ConcatSource", { enumerable: true, get: function
|
|
|
67
67
|
const MPPack_1 = require("./MPPack");
|
|
68
68
|
Object.defineProperty(exports, "AbstractMPPack", { enumerable: true, get: function () { return MPPack_1.AbstractMPPack; } });
|
|
69
69
|
Object.defineProperty(exports, "MPPack", { enumerable: true, get: function () { return MPPack_1.MPPack; } });
|
|
70
|
+
Object.defineProperty(exports, "watchIgnored", { enumerable: true, get: function () { return MPPack_1.watchIgnored; } });
|
|
70
71
|
const MPPackSetting_1 = __importDefault(require("./MPPackSetting"));
|
|
71
72
|
exports.MPPackSetting = MPPackSetting_1.default;
|
|
72
73
|
const utils = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhs-mp-pack",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20-beta.0",
|
|
4
4
|
"description": "xhs mp compiler core.",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"category": "esm",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"watchpack": "^2.4.0",
|
|
56
56
|
"webpack-chain": "^6.5.1",
|
|
57
57
|
"webpack-sources": "^3.2.3",
|
|
58
|
-
"xhs-mp-compiler-utils": "2.0.
|
|
59
|
-
"xhs-mp-project": "2.0.
|
|
60
|
-
"xhs-mp-shared-fs": "2.0.
|
|
58
|
+
"xhs-mp-compiler-utils": "2.0.20-beta.0",
|
|
59
|
+
"xhs-mp-project": "2.0.20-beta.0",
|
|
60
|
+
"xhs-mp-shared-fs": "2.0.20-beta.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/babel__generator": "7.6.3",
|