Skip to content

Commit

Permalink
migrate to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
UmangRobro committed Nov 7, 2023
1 parent 6dbd48e commit 358e02f
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 3,628 deletions.
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 All @@ -51,4 +52,4 @@
"@babel/runtime": "^7.10.2",
"@codexteam/icons": "^0.0.4"
}
}
}
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: "Link",
fileName: "link",
},
},
define: {
NODE_ENV: JSON.stringify(NODE_ENV),
VERSION: JSON.stringify(VERSION),
},

plugins: [cssInjectedByJsPlugin()],
};
Loading

0 comments on commit 358e02f

Please sign in to comment.