Included extension bundling

This commit is contained in:
Elio Struyf
2019-08-26 11:22:26 +02:00
parent a197d85d75
commit e55a4e561a
7 changed files with 3738 additions and 23 deletions

3
.gitignore vendored
View File

@@ -2,4 +2,5 @@ out
node_modules
.vscode-test/
*.vsix
.DS_Store
.DS_Store
dist

16
.vscode/launch.json vendored
View File

@@ -6,17 +6,17 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "npm: watch"
"preLaunchTask": "npm: webpack"
},
{
"name": "Extension Tests",
@@ -24,13 +24,13 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
"preLaunchTask": "npm: test-compile"
}
]
}

View File

@@ -7,4 +7,5 @@ vsc-extension-quickstart.md
**/tsconfig.json
**/tslint.json
**/*.map
**/*.ts
**/*.ts
webpack.config.js

View File

@@ -1,5 +1,9 @@
# Change Log
## [0.0.2] - 2019-08-26
- Updated extension to bundle the project output
## [0.0.1] - 2019-08-26
- Initial beta version

3666
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "vscode-front-matter",
"displayName": "vscode-front-matter",
"description": "Simplifies front matter configuration for your articles/posts/...",
"version": "0.0.1",
"version": "0.0.2",
"publisher": "eliostruyf",
"engines": {
"vscode": "^1.37.0"
@@ -17,10 +17,10 @@
"Taxonomy"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/estruyf/vscode-front-matter"
},
"repository": {
"type": "git",
"url": "https://github.com/estruyf/vscode-front-matter"
},
"activationEvents": [
"onCommand:frontMatter.insertTags",
"onCommand:frontMatter.insertCategories",
@@ -28,7 +28,7 @@
"onCommand:frontMatter.createCategory",
"onCommand:frontMatter.exportTaxonomy"
],
"main": "./out/extension.js",
"main": "./dist/extension",
"contributes": {
"configuration": {
"title": "Front Matter: Configuration",
@@ -67,11 +67,10 @@
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runTest.js"
"vscode:prepublish": "webpack --mode production",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch",
"test-compile": "tsc -p ./"
},
"devDependencies": {
"@types/glob": "^7.1.1",
@@ -80,9 +79,12 @@
"@types/vscode": "^1.37.0",
"glob": "^7.1.4",
"mocha": "^6.1.4",
"typescript": "^3.3.1",
"ts-loader": "^6.0.4",
"tslint": "^5.12.1",
"vscode-test": "^1.0.2"
"typescript": "^3.3.1",
"vscode-test": "^1.0.2",
"webpack": "^4.39.2",
"webpack-cli": "^3.3.7"
},
"dependencies": {
"gray-matter": "4.0.2"

41
webpack.config.js Normal file
View File

@@ -0,0 +1,41 @@
//@ts-check
'use strict';
const path = require('path');
/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
}
]
}
};
module.exports = config;