#modify package.json
This commit is contained in:
parent
4083925e6d
commit
ca4786ce41
@ -2,6 +2,7 @@
|
|||||||
.vscode-test/**
|
.vscode-test/**
|
||||||
test/**
|
test/**
|
||||||
.gitignore
|
.gitignore
|
||||||
|
.git
|
||||||
.yarnrc
|
.yarnrc
|
||||||
vsc-extension-quickstart.md
|
vsc-extension-quickstart.md
|
||||||
**/jsconfig.json
|
**/jsconfig.json
|
||||||
@ -10,6 +11,7 @@ vsc-extension-quickstart.md
|
|||||||
dist/**/*.map
|
dist/**/*.map
|
||||||
webpack.config.js
|
webpack.config.js
|
||||||
node_modules
|
node_modules
|
||||||
src/**
|
out1/**
|
||||||
vsixmake.js
|
vsixmake.js
|
||||||
script
|
script
|
||||||
|
CHANGELOG.md
|
10718
package-lock.json
generated
10718
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
1802
package.json
1802
package.json
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"outDir": "out",
|
"outDir": "out1",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2020"
|
"ES2020"
|
||||||
|
28
vsixmake.js
28
vsixmake.js
@ -1,17 +1,26 @@
|
|||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const fspath = require('path');
|
||||||
const hdlFile = require('./src/hdlFs/file');
|
|
||||||
const hdlPath = require('./src/hdlFs/path');
|
|
||||||
|
|
||||||
const PACKAGE_PATH = './package.json';
|
const PACKAGE_PATH = './package.json';
|
||||||
const SAVE_FOLDER = 'dist';
|
const SAVE_FOLDER = 'dist';
|
||||||
const WEBPACK_OUT_FOLDER = 'out';
|
const WEBPACK_OUT_FOLDER = 'out';
|
||||||
|
|
||||||
|
function readJSON(path) {
|
||||||
|
const context = fs.readFileSync(path, 'utf-8');
|
||||||
|
return JSON.parse(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function writeJSON(path, obj) {
|
||||||
|
const jsonString = JSON.stringify(obj, null, '\t');
|
||||||
|
fs.writeFileSync(path, jsonString);
|
||||||
|
}
|
||||||
|
|
||||||
function changeMain(path) {
|
function changeMain(path) {
|
||||||
const packageJS = hdlFile.pullJsonInfo(PACKAGE_PATH);
|
const packageJS = readJSON(PACKAGE_PATH);
|
||||||
packageJS.main = path;
|
packageJS.main = path;
|
||||||
hdlFile.pushJsonInfo(PACKAGE_PATH, packageJS);
|
writeJSON(PACKAGE_PATH, packageJS);
|
||||||
}
|
}
|
||||||
|
|
||||||
function findVsix() {
|
function findVsix() {
|
||||||
@ -35,10 +44,11 @@ changeMain('./src/extension');
|
|||||||
execSync('code --uninstall-extension sterben.digital-ide');
|
execSync('code --uninstall-extension sterben.digital-ide');
|
||||||
|
|
||||||
const vsix = findVsix();
|
const vsix = findVsix();
|
||||||
const targetPath = path.join(SAVE_FOLDER, vsix);
|
const targetPath = fspath.join(SAVE_FOLDER, vsix);
|
||||||
hdlFile.moveFile(vsix, targetPath, true);
|
fs.copyFileSync(vsix, targetPath);
|
||||||
hdlPath.deleteFolder(WEBPACK_OUT_FOLDER);
|
fs.unlinkSync(vsix);
|
||||||
|
fs.rm(WEBPACK_OUT_FOLDER, { recursive: true, force: true }, () => {});
|
||||||
|
|
||||||
const vsixPath = hdlPath.join(SAVE_FOLDER, vsix);
|
const vsixPath = fspath.join(SAVE_FOLDER, vsix);
|
||||||
// install new one
|
// install new one
|
||||||
execSync('code --install-extension ' + vsixPath);
|
execSync('code --install-extension ' + vsixPath);
|
25
webpack.config.js
Normal file
25
webpack.config.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
target: 'node',
|
||||||
|
entry: './out1/extension.js',
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'out'),
|
||||||
|
filename: 'extension.js',
|
||||||
|
libraryTarget: 'commonjs2',
|
||||||
|
devtoolModuleFilenameTemplate: '../[resource-path]',
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
vscode: 'commonjs vscode'
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.ts', '.js'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = (env, argv) => {
|
||||||
|
if (argv.mode === 'development') {
|
||||||
|
config.devtool = 'source-map';
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user