forked from editor-js/create-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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,7 @@ | ||
.github/ | ||
.idea/ | ||
src/ | ||
index.html | ||
tsconfig.json | ||
vite.config.js | ||
yarn.lock |
This file contains 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 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 |
---|---|---|
|
@@ -2,9 +2,7 @@ | |
<head> | ||
<title>Editor.js example page</title> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script> | ||
|
||
<script src="../dist/VAR_TOOL_NAME.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@editorjs/[email protected]"></script> | ||
|
||
<style> | ||
body { | ||
|
@@ -18,7 +16,9 @@ | |
<button id="save-button">Save</button> | ||
<pre id="output"></pre> | ||
|
||
<script> | ||
<script type="module"> | ||
import VAR_TOOL_NAME from './src/index.ts'; | ||
|
||
const editor = new EditorJS({ | ||
tools: { | ||
VAR_TOOL_NAME: { | ||
|
This file contains 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 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,21 +1,28 @@ | ||
import path from 'path'; | ||
|
||
export default { | ||
build: { | ||
rollupOptions: { | ||
input: { | ||
VAR_TOOL_NAME: path.resolve(__dirname, 'src/index.ts'), | ||
}, | ||
export default ({ command }) => { | ||
if (command === 'build') return { | ||
build: { | ||
rollupOptions: { | ||
input: { | ||
VAR_TOOL_NAME: path.resolve(__dirname, 'src/index.ts'), | ||
}, | ||
|
||
output: { | ||
name: 'VAR_TOOL_NAME', | ||
format: 'umd', | ||
output: { | ||
name: 'VAR_TOOL_NAME', | ||
format: 'umd', | ||
dir: 'dist', | ||
entryFileNames: '[name].js', | ||
}, | ||
|
||
dir: 'dist', | ||
entryFileNames: '[name].js', | ||
preserveEntrySignatures: 'strict', | ||
}, | ||
|
||
preserveEntrySignatures: 'strict', | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
return { | ||
server: { | ||
port: '3300' | ||
} | ||
}; | ||
} |