mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
update webpack config
This commit is contained in:
parent
b5316b913d
commit
6045cd727e
1
docs/assets/css/examples.d9912cd689b2d41695ab.css
Normal file
1
docs/assets/css/examples.d9912cd689b2d41695ab.css
Normal file
@ -0,0 +1 @@
|
||||
*{-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:100%;-webkit-touch-callout:none;box-sizing:border-box;margin:0;padding:0;text-rendering:optimizeLegibility;text-size-adjust:100%}:focus{outline:none}:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{color:#222;font-family:-apple-system,BlinkMacSystemFont,San Francisco,Roboto,Segoe UI,Helvetica Neue,sans-serif;font-size:18px;line-height:1.5}body{margin:0;padding:10% 20%}h1,h2,ol,p,pre,ul{margin:1rem 0}h1:first-child,h2:first-child,ol:first-child,p:first-child,pre:first-child,ul:first-child{margin-top:0}h1:last-child,h2:last-child,ol:last-child,p:last-child,pre:last-child,ul:last-child{margin-bottom:0}.icon[data-v-2b9db09d]{display:inline-block;fill:currentColor;height:.8rem;margin:0 .3rem;position:relative;top:-.05rem;vertical-align:middle;width:.8rem}.icon__svg[data-v-2b9db09d]{display:inline-block;height:100%;vertical-align:top;width:100%}.icon[data-v-2b9db09d]:first-child{margin-left:0}.icon[data-v-2b9db09d]:last-child{margin-right:0}.icon use>svg circle[data-v-2b9db09d],.icon use>svg g[data-v-2b9db09d],.icon use>svg path[data-v-2b9db09d],.icon use>svg rect[data-v-2b9db09d],body>svg circle[data-v-2b9db09d],body>svg g[data-v-2b9db09d],body>svg path[data-v-2b9db09d],body>svg rect[data-v-2b9db09d],symbol circle[data-v-2b9db09d],symbol g[data-v-2b9db09d],symbol path[data-v-2b9db09d],symbol rect[data-v-2b9db09d]{fill:currentColor;stroke:none}.icon use>svg [d="M0 0h24v24H0z"][data-v-2b9db09d],body>svg [d="M0 0h24v24H0z"][data-v-2b9db09d],symbol [d="M0 0h24v24H0z"][data-v-2b9db09d]{display:none}.editor{margin:0 auto 5rem;max-width:30rem;position:relative}.editor__content pre{background:#222;border-radius:5px;color:#fff;font-size:.8rem;padding:.7rem 1rem}.editor__content pre code{display:block}.editor__content ol,.editor__content ul{padding-left:1rem}.editor__content a{color:inherit}.menububble{-ms-transform:translateX(-50%);-webkit-transform:translateX(-50%);-webkit-transition:opacity .2s,visibility .2s;background:#222;border-radius:5px;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:.5rem;opacity:0;padding:.2rem;position:absolute;transform:translateX(-50%);transition:opacity .2s,visibility .2s;visibility:hidden;z-index:20}.menububble__button{background:rgba(0,0,0,0);border:0;border-radius:3px;color:#fff;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:.2rem;padding:.2rem .5rem}.menububble__button:last-child{margin-right:0}.menububble__button:hover{background-color:hsla(0,0%,100%,.1)}.menububble__button.is-active{background-color:hsla(0,0%,100%,.2)}.menububble__form{-ms-flex-align:center;-webkit-box-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.menububble__input{background:rgba(0,0,0,0);border:none;color:#fff;font:inherit}.menubar{-webkit-transition:visibility .2s .4s,opacity .2s .4s;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:1rem;opacity:0;transition:visibility .2s .4s,opacity .2s .4s;visibility:hidden}.menubar.is-focused{-webkit-transition:visibility .2s,opacity .2s;opacity:1;transition:visibility .2s,opacity .2s;visibility:visible}.menubar__button{background:rgba(0,0,0,0);border:0;border-radius:3px;color:#222;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;margin-right:.2rem;padding:.2rem .5rem}.menubar__button:hover{background-color:rgba(34,34,34,.05)}.menubar__button.is-active{background-color:rgba(34,34,34,.1)}.mention{background:rgba(34,34,34,.1);border-radius:5px;color:rgba(34,34,34,.6);font-size:.8rem;font-weight:700;padding:.2rem .5rem}ul[data-type=todo_list]{padding-left:0}li[data-type=todo_item]{-ms-flex-direction:row;-webkit-box-direction:normal;-webkit-box-orient:horizontal;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:row}.todo-checkbox{-moz-user-select:none;-ms-user-select:none;-webkit-box-sizing:border-box;-webkit-transition:background .4s;-webkit-user-select:none;background-color:rgba(0,0,0,0);border:2px solid #222;border-radius:.2em;box-sizing:border-box;cursor:pointer;height:.9em;margin-right:10px;margin-top:.3rem;transition:background .4s;user-select:none;width:.9em}.todo-content{-ms-flex:1;-webkit-box-flex:1;flex:1}li[data-done=true]{text-decoration:line-through}li[data-done=true] .todo-checkbox{background-color:#222}li[data-done=false]{text-decoration:none}
|
1
docs/assets/images/1534800214149.sprite.svg
Normal file
1
docs/assets/images/1534800214149.sprite.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="position:absolute;width:0;height:0"><symbol viewBox="0 0 24 24" id="icon--bold"><path d="M17.194 10.962A6.271 6.271 0 0 0 12.844.248H4.3a1.25 1.25 0 0 0 0 2.5h1.013a.25.25 0 0 1 .25.25V21a.25.25 0 0 1-.25.25H4.3a1.25 1.25 0 1 0 0 2.5h9.963a6.742 6.742 0 0 0 2.93-12.786zm-4.35-8.214a3.762 3.762 0 0 1 0 7.523H8.313a.25.25 0 0 1-.25-.25V3a.25.25 0 0 1 .25-.25zm1.42 18.5H8.313a.25.25 0 0 1-.25-.25v-7.977a.25.25 0 0 1 .25-.25h5.951a4.239 4.239 0 0 1 0 8.477z"/></symbol><symbol viewBox="0 0 24 24" id="icon--checklist"><path d="M21 0H3a3 3 0 0 0-3 3v18a3 3 0 0 0 3 3h18a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3zm1 21a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1z"/><path d="M11.249 4.5a1.251 1.251 0 0 0-1.75.25L7.365 7.6l-.482-.481a1.25 1.25 0 0 0-1.767 1.764l1.5 1.5a1.262 1.262 0 0 0 1.884-.134l3-4a1.25 1.25 0 0 0-.251-1.749zm0 9a1.251 1.251 0 0 0-1.75.25L7.365 16.6l-.482-.481a1.25 1.25 0 1 0-1.767 1.768l1.5 1.5a1.265 1.265 0 0 0 1.884-.138l3-4a1.25 1.25 0 0 0-.251-1.749zM18.5 7.749H14a1.25 1.25 0 0 0 0 2.5h4.5a1.25 1.25 0 0 0 0-2.5zm0 8H14a1.25 1.25 0 0 0 0 2.5h4.5a1.25 1.25 0 1 0 0-2.5z"/></symbol><symbol viewBox="0 0 24 24" id="icon--code"><path d="M9.147 21.552a1.244 1.244 0 0 1-.895-.378L.84 13.561a2.257 2.257 0 0 1 0-3.125l7.412-7.613a1.25 1.25 0 0 1 1.791 1.744l-6.9 7.083a.5.5 0 0 0 0 .7l6.9 7.082a1.25 1.25 0 0 1-.9 2.122zm5.707 0a1.25 1.25 0 0 1-.9-2.122l6.9-7.083a.5.5 0 0 0 0-.7l-6.9-7.082a1.25 1.25 0 0 1 1.791-1.744l7.411 7.612a2.257 2.257 0 0 1 0 3.125l-7.412 7.614a1.244 1.244 0 0 1-.89.38zm6.514-9.373z"/></symbol><symbol viewBox="0 0 24 24" id="icon--italic"><path d="M22.5.248h-7.637a1.25 1.25 0 0 0 0 2.5h1.086a.25.25 0 0 1 .211.384L4.78 21.017a.5.5 0 0 1-.422.231H1.5a1.25 1.25 0 0 0 0 2.5h7.637a1.25 1.25 0 0 0 0-2.5H8.051a.25.25 0 0 1-.211-.384L19.22 2.98a.5.5 0 0 1 .422-.232H22.5a1.25 1.25 0 0 0 0-2.5z"/></symbol><symbol viewBox="0 0 24 24" id="icon--link"><path d="M12.406 14.905a1 1 0 0 0-.543 1.307 1 1 0 0 1-.217 1.09l-2.828 2.829a2 2 0 0 1-2.828 0L3.868 18.01a2 2 0 0 1 0-2.829L6.7 12.353a1.013 1.013 0 0 1 1.091-.217 1 1 0 0 0 .763-1.849 3.034 3.034 0 0 0-3.268.652l-2.832 2.828a4.006 4.006 0 0 0 0 5.657l2.122 2.121a4 4 0 0 0 5.656 0l2.829-2.828a3.008 3.008 0 0 0 .651-3.27 1 1 0 0 0-1.306-.542z"/><path d="M7.757 16.241a1.011 1.011 0 0 0 1.414 0l7.779-7.778a1 1 0 0 0-1.414-1.414l-7.779 7.778a1 1 0 0 0 0 1.414z"/><path d="M21.546 4.574l-2.121-2.121a4.006 4.006 0 0 0-5.657 0l-2.829 2.828a3.006 3.006 0 0 0-.651 3.269 1 1 0 1 0 1.849-.764 1 1 0 0 1 .217-1.086l2.828-2.828a2 2 0 0 1 2.829 0l2.121 2.121a2 2 0 0 1 0 2.829L17.3 11.645a1.015 1.015 0 0 1-1.091.217 1 1 0 0 0-.765 1.849 3.026 3.026 0 0 0 3.27-.651l2.828-2.828a4.007 4.007 0 0 0 .004-5.658z"/></symbol><symbol viewBox="0 0 24 24" id="icon--ol"><path d="M7.75 4.5h15a1 1 0 0 0 0-2h-15a1 1 0 0 0 0 2zm15 6.5h-15a1 1 0 1 0 0 2h15a1 1 0 0 0 0-2zm0 8.5h-15a1 1 0 0 0 0 2h15a1 1 0 0 0 0-2zM2.212 17.248a2 2 0 0 0-1.933 1.484.75.75 0 1 0 1.45.386.5.5 0 1 1 .483.63.75.75 0 1 0 0 1.5.5.5 0 1 1-.482.635.75.75 0 1 0-1.445.4 2 2 0 1 0 3.589-1.648.251.251 0 0 1 0-.278 2 2 0 0 0-1.662-3.111zm2.038-6.5a2 2 0 0 0-4 0 .75.75 0 0 0 1.5 0 .5.5 0 0 1 1 0 1.031 1.031 0 0 1-.227.645L.414 14.029A.75.75 0 0 0 1 15.248h2.5a.75.75 0 0 0 0-1.5h-.419a.249.249 0 0 1-.195-.406L3.7 12.33a2.544 2.544 0 0 0 .55-1.582zM4 5.248h-.25A.25.25 0 0 1 3.5 5V1.623A1.377 1.377 0 0 0 2.125.248H1.5a.75.75 0 0 0 0 1.5h.25A.25.25 0 0 1 2 2v3a.25.25 0 0 1-.25.25H1.5a.75.75 0 0 0 0 1.5H4a.75.75 0 0 0 0-1.5z"/></symbol><symbol viewBox="0 0 24 24" id="icon--paragraph"><path d="M22.5.248H7.228a6.977 6.977 0 1 0 0 13.954h2.318a.25.25 0 0 1 .25.25V22.5a1.25 1.25 0 0 0 2.5 0V3a.25.25 0 0 1 .25-.25h3.682a.25.25 0 0 1 .25.25v19.5a1.25 1.25 0 0 0 2.5 0V3a.249.249 0 0 1 .25-.25H22.5a1.25 1.25 0 0 0 0-2.5zM9.8 11.452a.25.25 0 0 1-.25.25H7.228a4.477 4.477 0 1 1 0-8.954h2.318A.25.25 0 0 1 9.8 3z"/></symbol><symbol viewBox="0 0 24 24" id="icon--remove"><path d="M20.485 3.511A12.01 12.01 0 1 0 24 12a12.009 12.009 0 0 0-3.515-8.489zm-1.767 15.21A9.51 9.51 0 1 1 21.5 12a9.508 9.508 0 0 1-2.782 6.721z"/><path d="M16.987 7.01a1.275 1.275 0 0 0-1.8 0l-3.177 3.177L8.829 7.01a1.277 1.277 0 0 0-1.805 1.806l3.176 3.177-3.176 3.178a1.277 1.277 0 0 0 1.805 1.806l3.176-3.177 3.177 3.178a1.277 1.277 0 0 0 1.8-1.806l-3.176-3.178 3.176-3.177a1.278 1.278 0 0 0 .005-1.807z"/></symbol><symbol viewBox="0 0 24 24" id="icon--ul"><circle cx="2.5" cy="3.998" r="2.5"/><path d="M8.5 5H23a1 1 0 0 0 0-2H8.5a1 1 0 0 0 0 2z"/><circle cx="2.5" cy="11.998" r="2.5"/><path d="M23 11H8.5a1 1 0 0 0 0 2H23a1 1 0 0 0 0-2z"/><circle cx="2.5" cy="19.998" r="2.5"/><path d="M23 19H8.5a1 1 0 0 0 0 2H23a1 1 0 0 0 0-2z"/></symbol></svg>
|
After Width: | Height: | Size: 4.6 KiB |
8
docs/assets/js/examples.d9912cd689b2d41695ab.js
Normal file
8
docs/assets/js/examples.d9912cd689b2d41695ab.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/assets/js/examples.d9912cd689b2d41695ab.js.map
Normal file
1
docs/assets/js/examples.d9912cd689b2d41695ab.js.map
Normal file
File diff suppressed because one or more lines are too long
7
docs/assets/manifest.json
Normal file
7
docs/assets/manifest.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"examples.css": "/assets/css/examples.d9912cd689b2d41695ab.css",
|
||||
"examples.js": "/assets/js/examples.d9912cd689b2d41695ab.js",
|
||||
"examples.js.map": "/assets/js/examples.d9912cd689b2d41695ab.js.map",
|
||||
"index.html": "/index.html",
|
||||
"assets/images/1534800214149.sprite.svg": "/assets/images/1534800214149.sprite.svg"
|
||||
}
|
@ -1,12 +1 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>tiptap</title>
|
||||
</head>
|
||||
<body>
|
||||
tiptap
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="ie=edge"><title>Editor</title><meta name=viewport content="width=device-width,initial-scale=1"><meta name=mobile-web-app-capable content=yes><link href=/assets/css/examples.d9912cd689b2d41695ab.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/assets/js/examples.d9912cd689b2d41695ab.js></script></body></html>
|
@ -64,7 +64,7 @@
|
||||
|
||||
<script>
|
||||
import Icon from 'Components/Icon'
|
||||
import { Editor } from 'vue-mirror'
|
||||
import { Editor } from 'tiptap'
|
||||
import MentionPlugin from './plugins/Mention.js'
|
||||
|
||||
export default {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { Node } from 'tiptap/utils'
|
||||
|
||||
export default class MentionNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { setBlockType } from 'prosemirror-commands'
|
||||
import { nodeIsActive } from 'vue-mirror/utils'
|
||||
import { nodeIsActive } from 'tiptap/utils'
|
||||
|
||||
export default function (type, toggletype, attrs = {}) {
|
||||
return (state, dispatch, view) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { nodeIsActive } from 'vue-mirror/utils'
|
||||
import { wrapInList, liftListItem } from 'vue-mirror/helpers'
|
||||
import { nodeIsActive } from 'tiptap/utils'
|
||||
import { wrapInList, liftListItem } from 'tiptap/helpers'
|
||||
|
||||
export default function toggleList(type, itemType) {
|
||||
return (state, dispatch, view) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Mark } from 'vue-mirror/utils'
|
||||
import { toggleMark } from 'vue-mirror/helpers'
|
||||
import { Mark } from 'tiptap/utils'
|
||||
import { toggleMark } from 'tiptap/helpers'
|
||||
|
||||
export default class BoldMark extends Mark {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Mark } from 'vue-mirror/utils'
|
||||
import { toggleMark } from 'vue-mirror/helpers'
|
||||
import { Mark } from 'tiptap/utils'
|
||||
import { toggleMark } from 'tiptap/helpers'
|
||||
|
||||
export default class CodeMark extends Mark {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Mark } from 'vue-mirror/utils'
|
||||
import { toggleMark } from 'vue-mirror/helpers'
|
||||
import { Mark } from 'tiptap/utils'
|
||||
import { toggleMark } from 'tiptap/helpers'
|
||||
|
||||
export default class ItalicMark extends Mark {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Mark } from 'vue-mirror/utils'
|
||||
import { updateMark, removeMark } from 'vue-mirror/helpers'
|
||||
import { Mark } from 'tiptap/utils'
|
||||
import { updateMark, removeMark } from 'tiptap/helpers'
|
||||
|
||||
export default class LinkMark extends Mark {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { wrappingInputRule, setBlockType, wrapIn } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { wrappingInputRule, setBlockType, wrapIn } from 'tiptap/helpers'
|
||||
|
||||
export default class BlockquoteNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { wrappingInputRule, wrapInList, toggleList } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { wrappingInputRule, wrapInList, toggleList } from 'tiptap/helpers'
|
||||
|
||||
export default class BulletNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { toggleBlockType, setBlockType, textblockTypeInputRule } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { toggleBlockType, setBlockType, textblockTypeInputRule } from 'tiptap/helpers'
|
||||
|
||||
export default class CodeBlockNode extends Node {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { Node } from 'tiptap/utils'
|
||||
|
||||
export default class DocNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { chainCommands, exitCode } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { chainCommands, exitCode } from 'tiptap/helpers'
|
||||
|
||||
export default class HardBreakNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { setBlockType, textblockTypeInputRule, toggleBlockType } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { setBlockType, textblockTypeInputRule, toggleBlockType } from 'tiptap/helpers'
|
||||
|
||||
export default class HeadingNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { splitListItem, liftListItem, sinkListItem } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { splitListItem, liftListItem, sinkListItem } from 'tiptap/helpers'
|
||||
|
||||
export default class OrderedListNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { wrappingInputRule, wrapInList, toggleList } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { wrappingInputRule, wrapInList, toggleList } from 'tiptap/helpers'
|
||||
|
||||
export default class OrderedListNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { setBlockType } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { setBlockType } from 'tiptap/helpers'
|
||||
|
||||
export default class ParagraphNode extends Node {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { Node } from 'tiptap/utils'
|
||||
|
||||
export default class TextNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { splitListItem, liftListItem } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { splitListItem, liftListItem } from 'tiptap/helpers'
|
||||
|
||||
export default class TodoItemNode extends Node {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Node } from 'vue-mirror/utils'
|
||||
import { wrapInList, wrappingInputRule } from 'vue-mirror/helpers'
|
||||
import { Node } from 'tiptap/utils'
|
||||
import { wrapInList, wrappingInputRule } from 'tiptap/helpers'
|
||||
|
||||
export default class BulletNode extends Node {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { lift, selectParentNode } from 'prosemirror-commands'
|
||||
import { undo, redo } from 'prosemirror-history'
|
||||
import { undoInputRule } from 'prosemirror-inputrules'
|
||||
import { isMac } from 'vue-mirror/utils'
|
||||
import { isMac } from 'tiptap/utils'
|
||||
|
||||
const keymap = {
|
||||
'Mod-z': undo,
|
||||
|
@ -1,6 +1,8 @@
|
||||
import path from 'path'
|
||||
|
||||
export const rootPath = __dirname
|
||||
export const srcPath = path.resolve(rootPath, '../examples')
|
||||
export const srcPath = path.resolve(rootPath, '../src')
|
||||
export const buildPath = path.resolve(rootPath, '../dist')
|
||||
export const sassImportPath = srcPath
|
||||
export const examplesSrcPath = path.resolve(rootPath, '../examples')
|
||||
export const examplesBuildPath = path.resolve(rootPath, '../docs')
|
||||
export const sassImportPath = examplesSrcPath
|
||||
|
@ -9,22 +9,22 @@ import ImageminWebpackPlugin from 'imagemin-webpack-plugin'
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
||||
import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin'
|
||||
import { ifDev, ifProd, removeEmpty } from './utilities'
|
||||
import { rootPath, srcPath, buildPath } from './paths'
|
||||
import { rootPath, srcPath, examplesSrcPath, examplesBuildPath, buildPath } from './paths'
|
||||
|
||||
export default {
|
||||
|
||||
mode: ifDev('development', 'production'),
|
||||
|
||||
entry: {
|
||||
app: removeEmpty([
|
||||
examples: removeEmpty([
|
||||
ifDev('webpack-hot-middleware/client?reload=true'),
|
||||
`${srcPath}/assets/sass/main.scss`,
|
||||
`${srcPath}/main.js`,
|
||||
`${examplesSrcPath}/assets/sass/main.scss`,
|
||||
`${examplesSrcPath}/main.js`,
|
||||
]),
|
||||
},
|
||||
|
||||
output: {
|
||||
path: `${buildPath}/`,
|
||||
path: `${examplesBuildPath}/`,
|
||||
filename: `assets/js/[name]${ifProd('.[hash]', '')}.js`,
|
||||
chunkFilename: `assets/js/[name]${ifProd('.[chunkhash]', '')}.js`,
|
||||
publicPath: '/',
|
||||
@ -36,15 +36,15 @@ export default {
|
||||
vue$: 'vue/dist/vue.esm.js',
|
||||
modernizr: path.resolve(rootPath, '../.modernizr'),
|
||||
modules: path.resolve(rootPath, '../node_modules'),
|
||||
images: `${srcPath}/assets/images`,
|
||||
fonts: `${srcPath}/assets/fonts`,
|
||||
variables: `${srcPath}/assets/sass/variables`,
|
||||
settings: `${srcPath}/assets/sass/1-settings/index`,
|
||||
utilityFunctions: `${srcPath}/assets/sass/2-utility-functions/index`,
|
||||
'vue-mirror': path.resolve(rootPath, '../src'),
|
||||
images: `${examplesSrcPath}/assets/images`,
|
||||
fonts: `${examplesSrcPath}/assets/fonts`,
|
||||
variables: `${examplesSrcPath}/assets/sass/variables`,
|
||||
settings: `${examplesSrcPath}/assets/sass/1-settings/index`,
|
||||
utilityFunctions: `${examplesSrcPath}/assets/sass/2-utility-functions/index`,
|
||||
tiptap: path.resolve(rootPath, '../src'),
|
||||
},
|
||||
modules: [
|
||||
srcPath,
|
||||
examplesSrcPath,
|
||||
path.resolve(rootPath, '../node_modules'),
|
||||
],
|
||||
},
|
||||
@ -129,46 +129,16 @@ export default {
|
||||
}),
|
||||
|
||||
// define env
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
API_BASEURL: ifDev(
|
||||
JSON.stringify('http://local.app.scrumpy.io/api/'),
|
||||
JSON.stringify('https://app.scrumpy.io/api/'),
|
||||
),
|
||||
SOCKET_KEY: ifDev(
|
||||
JSON.stringify('981d87f7695904cec025e4039dd4048b'),
|
||||
JSON.stringify('981d87f7695904cec025e4039dd4048b'),
|
||||
),
|
||||
SOCKET_HOST: ifDev(
|
||||
JSON.stringify('http://local.socket.scrumpy.io/'),
|
||||
JSON.stringify('https://socket.scrumpy.io/'),
|
||||
),
|
||||
SUBSCRIPTIONS_HOST: ifDev(
|
||||
JSON.stringify('ws://local.subscriptions.scrumpy.io/'),
|
||||
JSON.stringify('wss://subscriptions.scrumpy.io/'),
|
||||
),
|
||||
STRIPE_KEY: ifDev(
|
||||
JSON.stringify('pk_test_yU17swZxi2a289XgEI9F20qS'),
|
||||
JSON.stringify('pk_live_XWgEzw9TgxpY8Tsf7PKXzk1k'),
|
||||
),
|
||||
CRISP_WEBSITE_ID: ifDev(
|
||||
null,
|
||||
JSON.stringify('463813ad-c274-4da1-8045-f5ceac88832b'),
|
||||
),
|
||||
ANALYTICS_ID: ifDev(
|
||||
null,
|
||||
JSON.stringify('UA-93829826-2'),
|
||||
),
|
||||
BUILD_VERSION: JSON.stringify(new Date().valueOf()),
|
||||
},
|
||||
}),
|
||||
// new webpack.DefinePlugin({
|
||||
// 'process.env': {},
|
||||
// }),
|
||||
|
||||
// copy static files
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
context: `${srcPath}/assets/static`,
|
||||
context: `${examplesSrcPath}/assets/static`,
|
||||
from: { glob: '**/*', dot: false },
|
||||
to: `${buildPath}/assets`,
|
||||
to: `${examplesBuildPath}/assets`,
|
||||
},
|
||||
]),
|
||||
|
||||
@ -186,7 +156,7 @@ export default {
|
||||
// html
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: `${srcPath}/index.html`,
|
||||
template: `${examplesSrcPath}/index.html`,
|
||||
inject: true,
|
||||
minify: ifProd({
|
||||
removeComments: true,
|
||||
|
Loading…
Reference in New Issue
Block a user