Skip to content

Commit a8b917a

Browse files
Update dependencies, improve angular support, fix bugs
1 parent 69940e2 commit a8b917a

File tree

8 files changed

+57
-8130
lines changed

8 files changed

+57
-8130
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"node": true
88
},
99
"parserOptions": {
10-
"ecmaVersion": 2018,
10+
"ecmaVersion": 2019,
1111
"sourceType": "module"
1212
},
1313
"rules": {

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
63+
# No package-lock
64+
package-lock.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

compilers/js.mjs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ const getBabelSetup = ctx => {
3434
babelTransformMixedImports,
3535
babelTransformExportDefault,
3636
babelTransformExportNamespace,
37-
[ babelTransformPaths, {
37+
[babelTransformPaths, {
3838
baseURI: ctx.store.baseURI,
3939
dirname: ctx.dirname,
4040
}],
41-
[ babelTransformDecorators, tsOptions ],
41+
[babelTransformDecorators, tsOptions],
4242
babelTransformParameterDecorators,
43-
[ babelTransformClassProperties, { loose: true }],
44-
[ babelTransformPrivateMethods, { loose: true }],
45-
[ babelTransformDefine, {
43+
[babelTransformClassProperties, { loose: true }],
44+
[babelTransformPrivateMethods, { loose: true }],
45+
[babelTransformDefine, {
4646
// TODO make it conditional
4747
'import.meta': { url: ctx.path },
4848
'process.env.NODE_ENV': 'development',
4949
'typeof window': 'object',
5050
}],
5151
babelMinifyDeadCode,
52-
[ babelTransformNameImports, { resolve: { vue: 'vue/dist/vue.esm.js' } }],
53-
[ babelTransformNamedImportToDestruct, {
52+
[babelTransformNameImports, { resolve: { vue: 'vue/dist/vue.esm.js' } }],
53+
[babelTransformNamedImportToDestruct, {
5454
baseURI: ctx.store.baseURI,
5555
map: '.map*',
56-
} ],
56+
}],
5757
babelTransformCssImport,
58-
[ babelTransformJsonImport, { dirname: ctx.stats.dirname }],
58+
[babelTransformJsonImport, { dirname: ctx.stats.dirname }],
5959
babelTransformModules,
6060
];
6161
if (ctx.path.endsWith('compiler/fesm5/compiler.js')) {
6262
plugins.unshift(patchAngularCompiler);
6363
}
6464
const presets = [
65-
[ babelPresetEnv, {
65+
[babelPresetEnv, {
6666
ignoreBrowserslistConfig: false,
6767
loose: true,
6868
modules: false,
@@ -72,7 +72,15 @@ const getBabelSetup = ctx => {
7272
}],
7373
];
7474
if (isTS) {
75-
plugins.unshift(babelTransformTypescript, babelTypeMetadata, babelDecoratorMetadata);
75+
plugins.unshift(
76+
[babelTransformTypescript, {
77+
allowNamespaces: true,
78+
isTSX: false,
79+
jsxPragma: 'React'
80+
}],
81+
babelTypeMetadata,
82+
babelDecoratorMetadata
83+
);
7684
} else {
7785
presets.push([
7886
babelPresetReact,
@@ -110,7 +118,7 @@ export default async (ctx, content, sourceMap, skipSM) => {
110118
comments: true,
111119
compact: false,
112120
configFile: false,
113-
extends: ctx.app.babelRC,
121+
extends: ctx.app.babelrc,
114122
filename: ctx.path,
115123
inputSourceMap,
116124
plugins,

middlewares/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const getBuild = async ctx => {
5858
const { ext } = ctx.stats;
5959
const { ua } = ctx.store;
6060
if (ext === '.map') {
61-
const { build: srcBuild} = ctx.app.table.get(ctx.srcPath.slice(0, -4)) || {};
61+
const { build: srcBuild } = ctx.app.table.get(ctx.srcPath.slice(0, -4)) || {};
6262
if (srcBuild) await srcBuild.get(ua);
6363
}
6464
const { build } = ctx.stats;

middlewares/resolve-path.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const resolvePath = async ctx => {
7575
ctx.dirname = path.dirname(ctx.path);
7676
// TODO: resolve size from build here
7777
ctx.size = 0;
78-
} else if(ctx.path.endsWith('favicon.ico')) {
78+
} else if (ctx.path.endsWith('favicon.ico')) {
7979
ctx.srcPath = `${scriptDir}/../hqjs.png`;
8080
ctx.dirname = path.dirname(ctx.path);
8181
const stats = await fs.lstat(ctx.srcPath);

0 commit comments

Comments
 (0)