Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 79106c2

Browse files
committed
fix: use siroc to build
* decreased file size by 25% πŸš€ closes #259
1 parent 601cc72 commit 79106c2

File tree

7 files changed

+269
-133
lines changed

7 files changed

+269
-133
lines changed

β€Ž.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ example
66
./dist
77
docs
88
coverage
9-
src/plugin.js
9+
templates
1010
dist

β€Ž.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ example
44
./dist
55
docs
66
coverage
7-
src/plugin.js
7+
templates

β€Žpackage.json

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
"name": "@nuxtjs/composition-api",
33
"version": "0.12.6",
44
"description": "Composition API hooks for Nuxt",
5-
"license": "MIT",
6-
"repository": "nuxt-community/composition-api",
7-
"author": {
8-
"name": "Daniel Roe",
9-
"email": "[email protected]",
10-
"url": "https://roe.dev"
11-
},
125
"keywords": [
136
"vue",
147
"vuejs",
@@ -17,6 +10,23 @@
1710
"typescript",
1811
"javascript"
1912
],
13+
"repository": "nuxt-community/composition-api",
14+
"license": "MIT",
15+
"author": {
16+
"name": "Daniel Roe",
17+
"email": "[email protected]",
18+
"url": "https://roe.dev"
19+
},
20+
"exports": {
21+
"babel": {
22+
"require": "./lib/babel.js",
23+
"import": "./lib/babel.es.js"
24+
},
25+
"entrypoint": {
26+
"require": "./lib/entrypoint.js",
27+
"import": "./lib/entrypoint.es.js"
28+
}
29+
},
2030
"main": "lib/index.js",
2131
"types": "lib/index.d.ts",
2232
"files": [
@@ -26,14 +36,13 @@
2636
],
2737
"scripts": {
2838
"build": "yarn clean && yarn compile",
29-
"watch": "yarn compile -w",
3039
"clean": "rm -rf lib/*",
3140
"clean:fixture": "rm -rf dist/ test/fixture/.nuxt",
32-
"compile": "rollup -c",
41+
"compile": "siroc build",
3342
"fixture": "cross-env CMD=dev yarn nuxt-run",
34-
"fixture:prod": "yarn clean:fixture && cross-env CMD=build yarn nuxt-run && cross-env CMD=start yarn nuxt-run",
35-
"fixture:generate:export": "yarn clean:fixture && cross-env GENERATE=true PORT=6000 CMD=generate yarn nuxt-run",
3643
"fixture:generate": "yarn fixture:generate:export && yarn http-server -s -p 5000 dist",
44+
"fixture:generate:export": "yarn clean:fixture && cross-env GENERATE=true PORT=6000 CMD=generate yarn nuxt-run",
45+
"fixture:prod": "yarn clean:fixture && cross-env CMD=build yarn nuxt-run && cross-env CMD=start yarn nuxt-run",
3746
"lint": "run-s lint:all:*",
3847
"lint:all:eslint": "yarn lint:eslint --ext .js,.ts,.vue .",
3948
"lint:all:prettier": "yarn lint:prettier \"**/*.{js,json,ts,vue}\"",
@@ -45,20 +54,12 @@
4554
"prepublishOnly": "yarn lint && yarn test",
4655
"release": "release-it",
4756
"test": "run-s test:*",
57+
"test:e2e-generated": "cross-env GENERATE=true PORT=5000 start-server-and-test fixture:generate 5000 \"testcafe -q firefox:headless test/e2e\"",
4858
"test:e2e-globals": "cross-env GLOBALS=true PORT=3000 start-server-and-test fixture:prod 3000 \"testcafe firefox:headless test/e2e\"",
4959
"test:e2e-ssr": "cross-env PORT=4000 start-server-and-test fixture:prod 4000 \"testcafe firefox:headless test/e2e\"",
50-
"test:e2e-generated": "cross-env GENERATE=true PORT=5000 start-server-and-test fixture:generate 5000 \"testcafe -q firefox:headless test/e2e\"",
5160
"test:types": "tsd",
52-
"test:unit": "jest"
53-
},
54-
"tsd": {
55-
"directory": "test/tsd",
56-
"compilerOptions": {
57-
"rootDir": "."
58-
}
59-
},
60-
"gitHooks": {
61-
"pre-commit": "lint-staged"
61+
"test:unit": "jest",
62+
"watch": "yarn compile -w"
6263
},
6364
"dependencies": {
6465
"@vue/composition-api": "1.0.0-beta.16",
@@ -72,6 +73,7 @@
7273
"@nuxt/types": "^2.14.6",
7374
"@nuxtjs/module-test-utils": "^1.6.3",
7475
"@release-it/conventional-changelog": "^2.0.0",
76+
"@types/fs-extra": "^9.0.2",
7577
"@types/jest": "^26.0.14",
7678
"@types/normalize-path": "^3.0.0",
7779
"@typescript-eslint/eslint-plugin": "^4.4.0",
@@ -91,10 +93,7 @@
9193
"nuxt": "^2.14.6",
9294
"prettier": "^2.1.2",
9395
"release-it": "14.1.0",
94-
"rollup": "^2.29.0",
95-
"rollup-plugin-copy": "^3.3.0",
96-
"rollup-plugin-dts": "^1.4.13",
97-
"rollup-plugin-typescript2": "^0.27.3",
96+
"siroc": "^0.4.0",
9897
"start-server-and-test": "^1.11.5",
9998
"testcafe": "1.9.4",
10099
"tsd": "^0.13.1",
@@ -103,9 +102,19 @@
103102
},
104103
"peerDependencies": {
105104
"@nuxt/vue-app": "^2.14.6",
105+
"fs-extra": "^8.1.0",
106106
"nuxt": "^2.14.6",
107107
"vue": "^2"
108108
},
109+
"gitHooks": {
110+
"pre-commit": "lint-staged"
111+
},
112+
"tsd": {
113+
"directory": "test/tsd",
114+
"compilerOptions": {
115+
"rootDir": "."
116+
}
117+
},
109118
"volta": {
110119
"node": "12.19.0"
111120
}

β€Žrollup.config.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

β€Žsrc/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const compositionApiModule: Module<any> = function () {
2929
}
3030

3131
const { dst: pluginDst } = this.addTemplate({
32-
src: resolve(libRoot, 'lib', 'plugin.js'),
32+
src: resolve(libRoot, 'templates', 'plugin.js'),
3333
fileName: join('composition-api', 'plugin.js'),
3434
options: {
3535
corejsPolyfill,
File renamed without changes.

0 commit comments

Comments
Β (0)