Skip to content

Commit 7214b75

Browse files
committed
fix: add pluginsCommon after language transpilers
1 parent 5139182 commit 7214b75

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

src/main.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,7 @@ export function createPlugins(
1212
babel: boolean = true,
1313
extraPlugins?: Array<any>
1414
) {
15-
let plugins = [
16-
autoExternal({
17-
builtins: true,
18-
dependencies: false,
19-
peerDependencies: false,
20-
}),
21-
22-
// so Rollup can find externals
23-
resolve({
24-
extensions: [".ts", ".js", ".coffee", ".tsx", ".jsx", ".mjs"],
25-
preferBuiltins: true,
26-
}),
27-
28-
// so Rollup can convert externals to an ES module
29-
commonjs(),
30-
];
15+
let plugins = []
3116

3217
// language specific
3318
// typescript
@@ -90,6 +75,25 @@ export function createPlugins(
9075
plugins.push(...extraPlugins);
9176
}
9277

78+
let pluginsCommon = [
79+
autoExternal({
80+
builtins: true,
81+
dependencies: false,
82+
peerDependencies: false,
83+
}),
84+
85+
// so Rollup can find externals
86+
resolve({
87+
extensions: [".ts", ".js", ".coffee", ".tsx", ".jsx", ".mjs"],
88+
preferBuiltins: true,
89+
}),
90+
91+
// so Rollup can convert externals to an ES module
92+
commonjs(),
93+
];
94+
95+
plugins.push(...pluginsCommon)
96+
9397
// minify only in production mode
9498
if (process.env.NODE_ENV === "production") {
9599
plugins.push(

0 commit comments

Comments
 (0)