Skip to content

Commit

Permalink
Merge pull request #85 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 861de29 + 94ed957 commit 5e34288
Show file tree
Hide file tree
Showing 8 changed files with 281 additions and 3,676 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

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
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
assets/
dev/
src/
.babelrc
.eslintrc
webpack.config.js
vite.config.js
postcss.config.js
yarn.lock
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/link",
"version": "2.5.0",
"version": "2.6.1",
"keywords": [
"codex editor",
"tool",
Expand All @@ -14,34 +14,35 @@
"type": "git",
"url": "git+https://github.com/editor-js/link.git"
},
"main": "./dist/bundle.js",
"files": [
"dist"
],
"main": "./dist/link.umd.js",
"module": "./dist/link.mjs",
"exports": {
".": {
"import": "./dist/link.mjs",
"require": "./dist/link.umd.js"
}
},
"scripts": {
"build": "webpack --mode production",
"build:dev": "webpack --mode development --watch",
"dev": "vite",
"build": "vite build",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix"
},
"author": "CodeX <[email protected]>",
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@codexteam/ajax": "^4.1.0",
"babel-loader": "^8.1.0",
"babel-preset-env": "^1.7.0",
"css-loader": "^3.5.3",
"eslint": "^7.1.0",
"eslint-config-codex": "^1.3.6",
"eslint-loader": "^4.0.2",
"open-graph": "^0.2.4",
"postcss-loader": "^3.0.0",
"postcss-nested": "^4.2.1",
"postcss-nested-ancestors": "^2.0.0",
"style-loader": "^1.2.1",
"svg-inline-loader": "^0.8.2",
"url-polyfill": "^1.1.9",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"vite": "^4.5.0",
"vite-plugin-css-injected-by-js": "^3.3.0"
},
"bugs": {
"url": "https://github.com/editor-js/link/issues"
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: [
require('postcss-nested-ancestors'),
require('postcss-nested'),
],
};
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: "LinkTool",
fileName: "link",
},
},
define: {
NODE_ENV: JSON.stringify(NODE_ENV),
VERSION: JSON.stringify(VERSION),
},

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

This file was deleted.

Loading

0 comments on commit 5e34288

Please sign in to comment.