Skip to content

Commit

Permalink
Merge pull request #59 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 14, 2023
2 parents c5c4739 + 3570e62 commit 8610c4d
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 739 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
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
assets/
src/
webpack.config.js
vite.config.js
postcss.config.js
yarn.lock
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ Use `Tab` and `Shift+Tab` keys to create or remove sublist with a padding.

## Installation

### Install via NPM

Get the package

```shell
npm i --save @editorjs/nested-list
```

Or

```shell
yarn add @editorjs/nested-list
```
Expand All @@ -30,13 +22,7 @@ Include module at your application
import NestedList from '@editorjs/nested-list';
```

### Load from CDN

Load the script from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/nested-list) and connect to your page.

```html
<script src="https://cdn.jsdelivr.net/npm/@editorjs/nested-list@latest"></script>
```
Optionally, you can load this tool from CDN [JsDelivr CDN](https://cdn.jsdelivr.net/npm/@editorjs/nested-list@latest)

## Usage

Expand Down
35 changes: 22 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
{
"name": "@editorjs/nested-list",
"version": "1.3.0",
"version": "1.4.0",
"keywords": [
"codex editor",
"nested-list",
"editor.js",
"editorjs"
],
"description": "Nested list Tool for EditorJS",
"main": "dist/nested-list.js",
"repository": "https://github.com/editor-js/nested-list.git",
"author": "CodeX <[email protected]>",
"license": "MIT",
"files": [
"dist"
],
"main": "./dist/nested-list.umd.js",
"module": "./dist/nested-list.mjs",
"exports": {
".": {
"import": "./dist/nested-list.mjs",
"require": "./dist/nested-list.umd.js"
}
},
"scripts": {
"prepare": "npm run build",
"build": "webpack --mode production",
"build:dev": "webpack --mode development --watch",
"dev": "vite",
"build": "vite build",
"lint": "eslint src/ --quiet",
"lint:errors": "eslint src/ --quiet",
"lint:fix": "eslint src/ --fix"
},
"devDependencies": {
"css-loader": "^5.0.2",
"eslint": "^7.22.0",
"eslint-loader": "^4.0.2",
"postcss": "^8.2.6",
"postcss-loader": "^4.2.0",
"postcss-nested": "^5.0.3",
"postcss-nested-ancestors": "^2.0.0",
"style-loader": "^2.0.0",
"webpack": "^5.24.1",
"webpack-cli": "^4.5.0"
"postcss-nested-ancestors": "^2.0.0"
},
"dependencies": {
"@codexteam/icons": "^0.0.2"
}
}
}
7 changes: 7 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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: "NestedList",
fileName: "nested-list",
},
},
define: {
NODE_ENV: JSON.stringify(NODE_ENV),
VERSION: JSON.stringify(VERSION),
},

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

This file was deleted.

Loading

0 comments on commit 8610c4d

Please sign in to comment.