Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 990fd5f

Browse filesBrowse files
committed
Fix node 12 support
1 parent 68274d6 commit 990fd5f
Copy full SHA for 990fd5f

File tree

Expand file treeCollapse file tree

3 files changed

+38
-27
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+38
-27
lines changed

‎package.json

Copy file name to clipboardExpand all lines: package.json
+12-9Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@
2727
],
2828
"sideEffects": false,
2929
"exports": {
30-
"production": {
31-
"require": "./dist/prod/index.js",
32-
"import": "./dist/prod/index.mjs"
33-
},
34-
"require": "./dist/index.js",
35-
"import": "./dist/index.mjs",
36-
"default": "./dist/index.mjs"
30+
".": {
31+
"production": {
32+
"require": "./dist/prod/index.cjs",
33+
"import": "./dist/prod/index.mjs"
34+
},
35+
"require": "./dist/index.cjs",
36+
"import": "./dist/index.mjs",
37+
"types": "./index.d.ts"
38+
}
3739
},
38-
"main": "dist/index.js",
40+
"main": "dist/index.cjs",
3941
"module": "dist/index.mjs",
4042
"unpkg": "dist/prod/index.global.js",
4143
"jsdelivr": "dist/prod/index.global.js",
@@ -49,7 +51,7 @@
4951
"node": ">=12.0.0"
5052
},
5153
"scripts": {
52-
"build": "tsup",
54+
"build": "rimraf dist && tsup",
5355
"lint": "eslint .",
5456
"ls-lint": "ls-lint",
5557
"typecheck": "tsc --noEmit -p tsconfig.json",
@@ -91,6 +93,7 @@
9193
"husky": "^8.0.1",
9294
"lint-staged": "^13.0.3",
9395
"release-it": "*",
96+
"rimraf": "^3.0.2",
9497
"tsup": "^6.2.3",
9598
"typescript": "^4.8.4",
9699
"vite": "^3.1.4",

‎pnpm-lock.yaml

Copy file name to clipboardExpand all lines: pnpm-lock.yaml
+2Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tsup.config.ts

Copy file name to clipboard
+24-18Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
import { defineConfig } from 'tsup'
22
import GlobalsPlugin from 'esbuild-plugin-globals'
33

4-
export default defineConfig([{
4+
const common = defineConfig({
55
entry: ['src/index.ts', 'src/composition.ts'],
66
format: ['esm', 'cjs', 'iife'],
7+
target: 'node12',
8+
outExtension: ({ format }) => {
9+
if (format === 'iife')
10+
return { js: '.global.js' }
11+
12+
if (format === 'cjs')
13+
return { js: '.cjs' }
14+
15+
if (format === 'esm')
16+
return { js: '.mjs' }
17+
18+
return { js: '.js' }
19+
},
720
globalName: 'FluentVue',
8-
outDir: 'dist/',
9-
dts: true,
1021
splitting: true,
11-
clean: true,
12-
env: {
13-
NODE_ENV: 'development',
14-
},
1522
esbuildPlugins: [
1623
GlobalsPlugin({
1724
'vue-demi': 'VueDemi',
1825
'@fluent/bundle': 'FluentBundle',
1926
}),
2027
],
2128
external: ['vue-demi', '@fluent/bundle'],
29+
})
30+
31+
export default defineConfig([{
32+
...common,
33+
outDir: 'dist/',
34+
dts: true,
35+
env: {
36+
NODE_ENV: 'development',
37+
},
2238
},
2339
{
24-
entry: ['src/index.ts', 'src/composition.ts'],
25-
format: ['esm', 'cjs', 'iife'],
26-
globalName: 'FluentVue',
40+
...common,
2741
outDir: 'dist/prod',
28-
splitting: true,
2942
env: {
3043
NODE_ENV: 'production',
3144
},
3245
minify: true,
33-
esbuildPlugins: [
34-
GlobalsPlugin({
35-
'vue-demi': 'VueDemi',
36-
'@fluent/bundle': 'FluentBundle',
37-
}),
38-
],
39-
external: ['vue-demi', '@fluent/bundle'],
4046
}])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.