Skip to content

Commit 3d322b4

Browse files
committed
migrated to vite
1 parent 7cc9471 commit 3d322b4

File tree

5 files changed

+222
-3466
lines changed

5 files changed

+222
-3466
lines changed

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.idea/
22
assets/
33
src/
4-
webpack.config.js
4+
vite.config.js
55
yarn.lock

package.json

+15-12
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@
55
"codex editor",
66
"inline",
77
"code",
8-
"tool",
98
"editor.js",
109
"editorjs"
1110
],
1211
"description": "InlineCode Tool for Editor.js",
1312
"license": "MIT",
1413
"repository": "https://github.com/editor-js/inline-code",
15-
"main": "./dist/bundle.js",
14+
"files": [
15+
"dist"
16+
],
17+
"main": "./dist/inline-code.umd.js",
18+
"module": "./dist/inline-code.mjs",
19+
"exports": {
20+
".": {
21+
"import": "./dist/inline-code.mjs",
22+
"require": "./dist/inline-code.umd.js"
23+
}
24+
},
1625
"scripts": {
17-
"build": "webpack --mode production",
18-
"build:dev": "webpack --mode development --watch"
26+
"dev": "vite",
27+
"build": "vite build"
1928
},
2029
"author": {
2130
"name": "CodeX Team",
2231
"email": "[email protected]"
2332
},
2433
"devDependencies": {
25-
"@babel/core": "^7.3.4",
26-
"@babel/preset-env": "^7.3.4",
27-
"babel-loader": "^8.0.5",
28-
"css-loader": "^1.0.0",
29-
"raw-loader": "^3.1.0",
30-
"style-loader": "^0.21.0",
31-
"webpack": "^4.29.5",
32-
"webpack-cli": "^3.2.3"
34+
"vite": "^4.5.0",
35+
"vite-plugin-css-injected-by-js": "^3.3.0"
3336
},
3437
"dependencies": {
3538
"@codexteam/icons": "^0.0.5"

vite.config.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import path from "path";
2+
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
3+
import * as pkg from "./package.json";
4+
5+
const NODE_ENV = process.argv.mode || "development";
6+
const VERSION = pkg.version;
7+
8+
export default {
9+
build: {
10+
copyPublicDir: false,
11+
lib: {
12+
entry: path.resolve(__dirname, "src", "index.js"),
13+
name: "Inline-code",
14+
fileName: "inline-code",
15+
},
16+
},
17+
define: {
18+
NODE_ENV: JSON.stringify(NODE_ENV),
19+
VERSION: JSON.stringify(VERSION),
20+
},
21+
22+
plugins: [cssInjectedByJsPlugin()],
23+
};

webpack.config.js

-42
This file was deleted.

0 commit comments

Comments
 (0)