Skip to content

Commit

Permalink
Merge pull request #97 from editor-js/migrate/vite
Browse files Browse the repository at this point in the history
Migrate to vite
  • Loading branch information
robonetphy authored Nov 8, 2023
2 parents 80278ee + af46ccd commit 87fa313
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 3,529 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 19
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea/
src/
webpack.config.js
vite.config.js
yarn.lock
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
{
"name": "@editorjs/header",
"version": "2.7.0",
"version": "2.8.0",
"keywords": [
"codex editor",
"header",
"tool",
"editor.js",
"editorjs"
],
"description": "Header Tool for Editor.js",
"license": "MIT",
"repository": "https://github.com/editor-js/header",
"main": "./dist/bundle.js",
"files": [
"dist"
],
"main": "./dist/header.umd.js",
"module": "./dist/header.mjs",
"exports": {
".": {
"import": "./dist/header.mjs",
"require": "./dist/header.umd.js"
}
},
"scripts": {
"build": "webpack --mode production",
"build:dev": "webpack --mode development --watch"
"dev": "vite",
"build": "vite build"
},
"author": {
"name": "CodeX",
"email": "[email protected]"
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"babel-loader": "^8.0.5",
"css-loader": "^1.0.0",
"raw-loader": "^3.1.0",
"style-loader": "^0.21.0",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
"vite": "^4.5.0",
"vite-plugin-css-injected-by-js": "^3.3.0"
},
"dependencies": {
"@codexteam/icons": "^0.0.5"
Expand Down
23 changes: 23 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import path from "path";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import * as pkg from "./package.json";

const NODE_ENV = process.argv.mode || "development";
const VERSION = pkg.version;

export default {
build: {
copyPublicDir: false,
lib: {
entry: path.resolve(__dirname, "src", "index.js"),
name: "Header",
fileName: "header",
},
},
define: {
NODE_ENV: JSON.stringify(NODE_ENV),
VERSION: JSON.stringify(VERSION),
},

plugins: [cssInjectedByJsPlugin()],
};
42 changes: 0 additions & 42 deletions webpack.config.js

This file was deleted.

Loading

0 comments on commit 87fa313

Please sign in to comment.