From bded16d33a97bddf3349029af0902c06dd28c69c Mon Sep 17 00:00:00 2001 From: u013235949 Date: Wed, 13 Nov 2024 16:31:00 +0800 Subject: [PATCH] Wed Nov 13 16:31:00 CST 2024 inscode --- index.js | 2 +- package.json | 6 +++++- webpack.config.js | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 webpack.config.js diff --git a/index.js b/index.js index ed6331c..b91e787 100644 --- a/index.js +++ b/index.js @@ -5,4 +5,4 @@ const file = new VFile('Hello') console.log('file', file.value) -console.log("欢迎来到 InsCode"); \ No newline at end of file +console.log("欢迎来到 webpack"); \ No newline at end of file diff --git a/package.json b/package.json index 4611466..0c91a92 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "scripts": { "dev": "node out.js", "prebuild": "esbuild index.js --bundle --outfile=out.js", + "webpackBuild": "webpack", + "webpackDev": "node dist/main.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], @@ -17,6 +19,8 @@ "vfile": "^6.0.3" }, "devDependencies": { - "esbuild": "0.24.0" + "esbuild": "0.24.0", + "webpack": "^5.96.1", + "webpack-cli": "^5.1.4" } } diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..e395719 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,9 @@ +const path = require('path'); + +module.exports = { + entry: './index.js', + output: { + filename: 'main.js', + path: path.resolve(__dirname, 'dist'), + }, +}; \ No newline at end of file -- GitLab