-
Notifications
You must be signed in to change notification settings - Fork 69
fix production build and migrate from webpack to vite #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
49e3bac
fix production build
bettysteger 9b9e22c
Revert "fix production build"
bettysteger f08ba4c
migrate from webpack to vite and add dev example
bettysteger ae98ab6
use resusable github workflow for npm-publish
bettysteger e0d54bd
update github action versions
bettysteger f68dd1d
move @codexteam/ajax dependency
bettysteger cfc66be
add node version
bettysteger a0f9316
fix node version
bettysteger 205a08d
Create .nvmrc
neSpecc 73c6ad7
Update index.css
neSpecc 25be3f5
Update package.json
neSpecc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| .idea/ | ||
| src/ | ||
| .eslintrc | ||
| webpack.config.js | ||
| vite.config.js | ||
| yarn.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Attaches Plugin Test | EditorJS</title> | ||
| </head> | ||
| <body> | ||
| <div id="editorjs"></div> | ||
| <script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script> | ||
| <script type="module"> | ||
| import AttachesTool from "../src/index.js"; | ||
| const editor = new EditorJS({ | ||
| holder: "editorjs", | ||
| data: { | ||
| time: 1700475383740, | ||
| blocks: [], | ||
| }, | ||
|
|
||
| tools: { | ||
| image: { | ||
| class: AttachesTool, | ||
| config: { | ||
| endpoint: "http://localhost:8008/uploadFile" | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,45 @@ | ||
| { | ||
| "name": "@editorjs/attaches", | ||
| "version": "1.3.1", | ||
| "repository": "https://github.com/editor-js/attaches", | ||
| "license": "MIT", | ||
| "scripts": { | ||
| "build": "webpack --mode production", | ||
| "build:dev": "webpack --mode development --watch", | ||
| "server": "node ./dev/server.js" | ||
| }, | ||
| "keywords": [ | ||
| "codex editor", | ||
| "tool", | ||
| "attaches", | ||
| "editor.js", | ||
| "editorjs" | ||
| ], | ||
| "description": "Attaches Tool for Editor.js", | ||
| "license": "MIT", | ||
| "repository": "https://github.com/editor-js/attaches", | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "main": "./dist/attaches.umd.js", | ||
| "module": "./dist/attaches.mjs", | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/attaches.mjs", | ||
| "require": "./dist/attaches.umd.js" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "dev": "concurrently \"vite\" \"node ./dev/server.js\"", | ||
| "build": "vite build" | ||
| }, | ||
| "author": { | ||
| "name": "CodeX", | ||
| "email": "team@codex.so" | ||
| }, | ||
| "main": "./dist/bundle.js", | ||
| "devDependencies": { | ||
| "@babel/core": "^7.14.2", | ||
| "@babel/preset-env": "^7.14.2", | ||
| "@codexteam/ajax": "^4.0.1", | ||
| "babel-loader": "^8.2.2", | ||
| "css-loader": "^1.0.0", | ||
| "eslint": "^7.32.0", | ||
| "eslint-config-codex": "^1.6.4", | ||
| "eslint-webpack-plugin": "^3.2.0", | ||
| "file-loader": "^4.1.0", | ||
| "formidable": "^1.2.1", | ||
| "postcss-loader": "^3.0.0", | ||
| "postcss-nested": "^4.1.1", | ||
| "postcss-nested-ancestors": "^2.0.0", | ||
| "request": "^2.88.0", | ||
| "style-loader": "^0.21.0", | ||
| "svg-inline-loader": "^0.8.2", | ||
| "to-string-loader": "^1.2.0", | ||
| "webpack": "^4.29.6", | ||
| "webpack-cli": "^3.3.0" | ||
| "@codexteam/ajax": "^4.2.0", | ||
| "@editorjs/editorjs": "2.30.0-rc.12", | ||
| "concurrently": "^9.0.1", | ||
| "formidable": "^3.5.1", | ||
| "postcss-nested": "^7.0.2", | ||
| "postcss-nested-ancestors": "^3.0.0", | ||
| "vite": "^5.3.1", | ||
| "vite-plugin-css-injected-by-js": "^3.5.1" | ||
| }, | ||
| "dependencies": { | ||
| "@codexteam/icons": "^0.0.4" | ||
| "@codexteam/icons": "^0.3.0" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| module.exports = { | ||
| plugins: [ | ||
| require('postcss-nested-ancestors'), | ||
| require('postcss-nested'), | ||
| ], | ||
| }; |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 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: "AttachesTool", | ||
| fileName: "attaches", | ||
| }, | ||
| }, | ||
| server: { | ||
| open: './dev/index.html', | ||
| }, | ||
| define: { | ||
| NODE_ENV: JSON.stringify(NODE_ENV), | ||
| VERSION: JSON.stringify(VERSION), | ||
| }, | ||
|
|
||
| plugins: [cssInjectedByJsPlugin()], | ||
| }; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codexteam/ajaxlooks like production dependency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will move, but in https://github.com/editor-js/image/blob/master/package.json it is also under
devDependencies