master
宇天 2021-07-05 17:51:45 +08:00
parent 4bd92ee621
commit dfdaed18f6
5 changed files with 8 additions and 32 deletions

2
.gitignore vendored
View File

@ -13,4 +13,6 @@ package-lock.json
node_modules node_modules
.vscode-test .vscode-test
out.js
*.vsix *.vsix
*.css

View File

@ -5,7 +5,6 @@ test/**
package-lock.json package-lock.json
.travis.yml .travis.yml
.gitignore .gitignore
entry.js index.js
rollup.config.js
test.js test.js

View File

@ -64,8 +64,6 @@ const Compiler = {
let target = origin.replace(/\.scss$/, '') let target = origin.replace(/\.scss$/, '')
let task = [] let task = []
console.log(origin, target)
// 说明不是scss文件 // 说明不是scss文件
if (origin === target) { if (origin === target) {
return return
@ -96,7 +94,6 @@ const Compiler = {
Promise.all(task) Promise.all(task)
.then(list => { .then(list => {
console.log('>'.repeat(50), '\n', list)
list.forEach(it => { list.forEach(it => {
fs.echo(it.css, it.output) fs.echo(it.css, it.output)
}) })

View File

@ -11,7 +11,7 @@
}, },
"categories": ["Formatters"], "categories": ["Formatters"],
"activationEvents": ["*"], "activationEvents": ["*"],
"main": "index.js", "main": "out.js",
"contributes": { "contributes": {
"commands": [ "commands": [
{ {
@ -78,8 +78,8 @@
"yutent" "yutent"
], ],
"scripts": { "scripts": {
"start": "npm run vscode:prepublish", "start": "esbuild entry.js --bundle --outfile=index.js --external:vscode --format=cjs --platform=node",
"vscode:prepublish": "rollup -c" "vscode:prepublish": "npm start -- --minify"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -89,9 +89,6 @@
"sass": "^1.35.1" "sass": "^1.35.1"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^19.0.0", "esbuild": "^0.12.14"
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"rollup": "^2.52.7"
} }
} }

View File

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