From dfdaed18f6b1f2bf6c83c5bed7b0c5c632ae64a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 5 Jul 2021 17:51:45 +0800 Subject: [PATCH] fixed --- .gitignore | 4 +++- .vscodeignore | 3 +-- entry.js => index.js | 3 --- package.json | 11 ++++------- rollup.config.js | 19 ------------------- 5 files changed, 8 insertions(+), 32 deletions(-) rename entry.js => index.js (98%) delete mode 100644 rollup.config.js diff --git a/.gitignore b/.gitignore index 6e2a731..ec781c0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ package-lock.json node_modules .vscode-test -*.vsix \ No newline at end of file +out.js +*.vsix +*.css \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore index 4608c45..1bd2951 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -5,7 +5,6 @@ test/** package-lock.json .travis.yml .gitignore -entry.js -rollup.config.js +index.js test.js diff --git a/entry.js b/index.js similarity index 98% rename from entry.js rename to index.js index 88512b0..452b894 100644 --- a/entry.js +++ b/index.js @@ -64,8 +64,6 @@ const Compiler = { let target = origin.replace(/\.scss$/, '') let task = [] - console.log(origin, target) - // 说明不是scss文件 if (origin === target) { return @@ -96,7 +94,6 @@ const Compiler = { Promise.all(task) .then(list => { - console.log('>'.repeat(50), '\n', list) list.forEach(it => { fs.echo(it.css, it.output) }) diff --git a/package.json b/package.json index 8b3d321..7f82697 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "categories": ["Formatters"], "activationEvents": ["*"], - "main": "index.js", + "main": "out.js", "contributes": { "commands": [ { @@ -78,8 +78,8 @@ "yutent" ], "scripts": { - "start": "npm run vscode:prepublish", - "vscode:prepublish": "rollup -c" + "start": "esbuild entry.js --bundle --outfile=index.js --external:vscode --format=cjs --platform=node", + "vscode:prepublish": "npm start -- --minify" }, "license": "MIT", "dependencies": { @@ -89,9 +89,6 @@ "sass": "^1.35.1" }, "devDependencies": { - "@rollup/plugin-commonjs": "^19.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.0.0", - "rollup": "^2.52.7" + "esbuild": "^0.12.14" } } diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index b79c0b9..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -import json from '@rollup/plugin-json' -import commonjs from '@rollup/plugin-commonjs' -import resolve from '@rollup/plugin-node-resolve' - -export default { - input: 'entry.js', - output: { - file: 'index.js', - format: 'cjs' - }, - external: ['vscode', 'fs', 'path', 'url', 'events'], - plugins: [ - json(), - commonjs({ - ignoreDynamicRequires: true - }), - resolve() - ] -}