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() - ] -}