tg-ganttchart 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +2 -0
  2. package/dist/demo.html +1 -0
  3. package/dist/tgganttchart.common.js +9529 -0
  4. package/dist/tgganttchart.common.js.map +1 -0
  5. package/dist/tgganttchart.css +1 -0
  6. package/dist/tgganttchart.umd.js +9540 -0
  7. package/dist/tgganttchart.umd.js.map +1 -0
  8. package/dist/tgganttchart.umd.min.js +7 -0
  9. package/dist/tgganttchart.umd.min.js.map +1 -0
  10. package/package.json +8 -4
  11. package/babel.config.js +0 -5
  12. package/src/components/GanttElastic.standalone.vue +0 -349
  13. package/src/components/GanttElastic.vue +0 -1643
  14. package/src/components/components/Calendar/Calendar.vue +0 -332
  15. package/src/components/components/Calendar/CalendarRow.vue +0 -85
  16. package/src/components/components/Chart/Chart.vue +0 -110
  17. package/src/components/components/Chart/DaysHighlight.vue +0 -70
  18. package/src/components/components/Chart/DependencyLines.vue +0 -112
  19. package/src/components/components/Chart/Grid.vue +0 -164
  20. package/src/components/components/Chart/ProgressBar.vue +0 -109
  21. package/src/components/components/Chart/Row/Milestone.vue +0 -117
  22. package/src/components/components/Chart/Row/Project.vue +0 -131
  23. package/src/components/components/Chart/Row/Task.mixin.js +0 -47
  24. package/src/components/components/Chart/Row/Task.vue +0 -107
  25. package/src/components/components/Chart/Text.vue +0 -105
  26. package/src/components/components/Expander.vue +0 -126
  27. package/src/components/components/Header/Header.vue +0 -266
  28. package/src/components/components/MainView.vue +0 -282
  29. package/src/components/components/TaskList/ItemColumn.vue +0 -98
  30. package/src/components/components/TaskList/TaskList.vue +0 -42
  31. package/src/components/components/TaskList/TaskListHeader.vue +0 -143
  32. package/src/components/components/TaskList/TaskListItem.vue +0 -39
  33. package/src/components/components/bundle.js +0 -28
  34. package/src/index.js +0 -13
  35. package/vue.config.js +0 -42
@@ -1,282 +0,0 @@
1
-
2
- <template>
3
- <div class="gantt-elastic__main-view" :style="{ ...root.style['main-view'] }">
4
- <div
5
- class="gantt-elastic__main-container-wrapper"
6
- :style="{ ...root.style['main-container-wrapper'], height: root.state.options.height + 'px' }"
7
- >
8
- <div
9
- class="gantt-elastic__main-container"
10
- :style="{
11
- ...root.style['main-container'],
12
- width: root.state.options.clientWidth + 'px',
13
- height: root.state.options.height + 'px'
14
- }"
15
- ref="mainView"
16
- >
17
- <div
18
- class="gantt-elastic__container"
19
- :style="{ ...root.style['container'] }"
20
- @mousemove="mouseMove"
21
- @mouseup="mouseUp"
22
- >
23
- <div
24
- ref="taskList"
25
- class="gantt-elastic__task-list-container"
26
- :style="{
27
- ...root.style['task-list-container'],
28
- width: root.state.options.taskList.finalWidth + 'px',
29
- height: root.state.options.height + 'px'
30
- }"
31
- v-show="root.state.options.taskList.display"
32
- >
33
- <task-list></task-list>
34
- </div>
35
- <div
36
- class="gantt-elastic__main-view-container"
37
- :style="{ ...root.style['main-view-container'] }"
38
- ref="chartContainer"
39
- @mousedown="chartMouseDown"
40
- @touchstart="chartMouseDown"
41
- @mouseup="chartMouseUp"
42
- @touchend="chartMouseUp"
43
- @mousemove.prevent="chartMouseMove"
44
- @touchmove.prevent="chartMouseMove"
45
- @wheel.prevent="chartWheel"
46
- >
47
- <chart></chart>
48
- </div>
49
- </div>
50
- </div>
51
- <div
52
- class="gantt-elastic__chart-scroll-container gantt-elastic__chart-scroll-container--vertical"
53
- :style="{
54
- ...root.style['chart-scroll-container'],
55
- ...root.style['chart-scroll-container--vertical'],
56
- ...verticalStyle
57
- }"
58
- ref="chartScrollContainerVertical"
59
- @scroll="onVerticalScroll"
60
- >
61
- <div
62
- class="gantt-elastic__chart-scroll--vertical"
63
- :style="{ width: '1px', height: root.state.options.allVisibleTasksHeight + 'px' }"
64
- ></div>
65
- </div>
66
- </div>
67
- <div
68
- class="gantt-elastic__chart-scroll-container gantt-elastic__chart-scroll-container--horizontal"
69
- :style="{
70
- ...root.style['chart-scroll-container'],
71
- ...root.style['chart-scroll-container--horizontal'],
72
- marginLeft: getMarginLeft
73
- }"
74
- @scroll="onHorizontalScroll"
75
- ref="chartScrollContainerHorizontal"
76
- >
77
- <div
78
- class="gantt-elastic__chart-scroll--horizontal"
79
- :style="{ height: '1px', width: root.state.options.width + 'px' }"
80
- ></div>
81
- </div>
82
- </div>
83
- </template>
84
-
85
- <script>
86
- import TaskList from './TaskList/TaskList.vue';
87
- import Chart from './Chart/Chart.vue';
88
-
89
- let ignoreScrollEvents = false;
90
-
91
- export default {
92
- name: 'MainView',
93
- components: {
94
- TaskList,
95
- Chart
96
- },
97
- inject: ['root'],
98
- data() {
99
- return {
100
- defs: '',
101
- mousePos: {
102
- x: 0,
103
- y: 0,
104
- movementX: 0,
105
- movementY: 0,
106
- lastX: 0,
107
- lastY: 0,
108
- positiveX: 0,
109
- positiveY: 0,
110
- currentX: 0,
111
- currentY: 0
112
- }
113
- };
114
- },
115
- /**
116
- * Mounted
117
- */
118
- mounted() {
119
- this.viewBoxWidth = this.$el.clientWidth;
120
- this.root.state.refs.mainView = this.$refs.mainView;
121
- this.root.state.refs.chartContainer = this.$refs.chartContainer;
122
- this.root.state.refs.taskList = this.$refs.taskList;
123
- this.root.state.refs.chartScrollContainerHorizontal = this.$refs.chartScrollContainerHorizontal;
124
- this.root.state.refs.chartScrollContainerVertical = this.$refs.chartScrollContainerVertical;
125
- document.addEventListener('mouseup', this.chartMouseUp.bind(this));
126
- document.addEventListener('mousemove', this.chartMouseMove.bind(this));
127
- document.addEventListener('touchmove', this.chartMouseMove.bind(this));
128
- document.addEventListener('touchend', this.chartMouseUp.bind(this));
129
- },
130
- computed: {
131
- /**
132
- * Get margin left
133
- *
134
- * @returns {string}
135
- */
136
- getMarginLeft() {
137
- if (!this.root.state.options.taskList.display) {
138
- return '0px';
139
- }
140
- return this.root.state.options.taskList.finalWidth + 'px';
141
- },
142
-
143
- /**
144
- * Get vertical style
145
- *
146
- * @returns {object}
147
- */
148
- verticalStyle() {
149
- return {
150
- width: this.root.state.options.scrollBarHeight + 'px',
151
- height: this.root.state.options.rowsHeight + 'px',
152
- 'margin-top': this.root.state.options.calendar.height + this.root.state.options.calendar.gap + 'px'
153
- };
154
- },
155
-
156
- /**
157
- * Get view box
158
- *
159
- * @returns {string}
160
- */
161
- getViewBox() {
162
- if (this.root.state.options.clientWidth) {
163
- return `0 0 ${this.root.state.options.clientWidth - this.root.state.options.scrollBarHeight} ${
164
- this.root.state.options.height
165
- }`;
166
- }
167
- return `0 0 0 ${this.root.state.options.height}`;
168
- }
169
- },
170
- methods: {
171
- /**
172
- * Emit event when mouse is moving inside main view
173
- */
174
- mouseMove(event) {
175
- this.root.$emit('main-view-mousemove', event);
176
- },
177
-
178
- /**
179
- * Emit mouseup event inside main view
180
- */
181
- mouseUp(event) {
182
- this.root.$emit('main-view-mouseup', event);
183
- },
184
-
185
- /**
186
- * Horizontal scroll event handler
187
- */
188
- onHorizontalScroll(ev) {
189
- this.root.$emit('chart-scroll-horizontal', ev);
190
- },
191
-
192
- /**
193
- * Vertical scroll event handler
194
- */
195
- onVerticalScroll(ev) {
196
- this.root.$emit('chart-scroll-vertical', ev);
197
- },
198
-
199
- /**
200
- * Mouse wheel event handler
201
- */
202
- chartWheel(ev) {
203
- this.root.$emit('chart-wheel', ev);
204
- },
205
-
206
- /**
207
- * Chart mousedown event handler
208
- * Initiates drag scrolling mode
209
- */
210
- chartMouseDown(ev) {
211
- if (typeof ev.touches !== 'undefined') {
212
- this.mousePos.x = this.mousePos.lastX = ev.touches[0].screenX;
213
- this.mousePos.y = this.mousePos.lastY = ev.touches[0].screenY;
214
- this.mousePos.movementX = 0;
215
- this.mousePos.movementY = 0;
216
- this.mousePos.currentX = this.$refs.chartScrollContainerHorizontal.scrollLeft;
217
- this.mousePos.currentY = this.$refs.chartScrollContainerVertical.scrollTop;
218
- }
219
- this.root.state.options.scroll.scrolling = true;
220
- },
221
-
222
- /**
223
- * Chart mouseup event handler
224
- * Deactivates drag scrolling mode
225
- */
226
- chartMouseUp(ev) {
227
- this.root.state.options.scroll.scrolling = false;
228
- },
229
-
230
- /**
231
- * Chart mousemove event handler
232
- * When in drag scrolling mode this method calculate scroll movement
233
- */
234
- chartMouseMove(ev) {
235
- if (this.root.state.options.scroll.scrolling) {
236
- ev.preventDefault();
237
- ev.stopImmediatePropagation();
238
- ev.stopPropagation();
239
- const touch = typeof ev.touches !== 'undefined';
240
- let movementX, movementY;
241
- if (touch) {
242
- const screenX = ev.touches[0].screenX;
243
- const screenY = ev.touches[0].screenY;
244
- movementX = this.mousePos.x - screenX;
245
- movementY = this.mousePos.y - screenY;
246
- this.mousePos.lastX = screenX;
247
- this.mousePos.lastY = screenY;
248
- } else {
249
- movementX = ev.movementX;
250
- movementY = ev.movementY;
251
- }
252
- const horizontal = this.$refs.chartScrollContainerHorizontal;
253
- const vertical = this.$refs.chartScrollContainerVertical;
254
- let x = 0,
255
- y = 0;
256
- if (touch) {
257
- x = this.mousePos.currentX + movementX * this.root.state.options.scroll.dragXMoveMultiplier;
258
- } else {
259
- x = horizontal.scrollLeft - movementX * this.root.state.options.scroll.dragXMoveMultiplier;
260
- }
261
- horizontal.scrollLeft = x;
262
- if (touch) {
263
- y = this.mousePos.currentY + movementY * this.root.state.options.scroll.dragYMoveMultiplier;
264
- } else {
265
- y = vertical.scrollTop - movementY * this.root.state.options.scroll.dragYMoveMultiplier;
266
- }
267
- vertical.scrollTop = y;
268
- }
269
- }
270
- },
271
-
272
- /**
273
- * Before destroy event - clean up
274
- */
275
- // beforeDestroy() {
276
- // document.removeEventListener('mouseup', this.chartMouseUp);
277
- // document.removeEventListener('mousemove', this.chartMouseMove);
278
- // document.removeEventListener('touchmove', this.chartMouseMove);
279
- // document.removeEventListener('touchend', this.chartMouseUp);
280
- // }
281
- };
282
- </script>
@@ -1,98 +0,0 @@
1
- <template>
2
- <div class="gantt-elastic__task-list-item-column" :style="itemColumnStyle">
3
- <div class="gantt-elastic__task-list-item-value-wrapper" :style="wrapperStyle">
4
- <slot></slot>
5
- <div class="gantt-elastic__task-list-item-value-container" :style="containerStyle">
6
- <div
7
- class="gantt-elastic__task-list-item-value"
8
- :style="valueStyle"
9
- @click="emitEvent('click', $event)"
10
- @mouseenter="emitEvent('mouseenter', $event)"
11
- @mouseover="emitEvent('mouseover', $event)"
12
- @mouseout="emitEvent('mouseout', $event)"
13
- @mousemove="emitEvent('mousemove', $event)"
14
- @mousedown="emitEvent('mousedown', $event)"
15
- @mouseup="emitEvent('mouseup', $event)"
16
- @mousewheel="emitEvent('mousewheel', $event)"
17
- @touchstart="emitEvent('touchstart', $event)"
18
- @touchmove="emitEvent('touchmove', $event)"
19
- @touchend="emitEvent('touchend', $event)"
20
- v-if="!html"
21
- >
22
- {{ value }}
23
- </div>
24
- <div
25
- class="gantt-elastic__task-list-item-value"
26
- :style="valueStyle"
27
- v-else
28
- v-html="value"
29
- @click="emitEvent('click', $event)"
30
- @mouseenter="emitEvent('mouseenter', $event)"
31
- @mouseover="emitEvent('mouseover', $event)"
32
- @mouseout="emitEvent('mouseout', $event)"
33
- @mousemove="emitEvent('mousemove', $event)"
34
- @mousedown="emitEvent('mousedown', $event)"
35
- @mouseup="emitEvent('mouseup', $event)"
36
- @mousewheel="emitEvent('mousewheel', $event)"
37
- @touchstart="emitEvent('touchstart', $event)"
38
- @touchmove="emitEvent('touchmove', $event)"
39
- @touchend="emitEvent('touchend', $event)"
40
- ></div>
41
- </div>
42
- </div>
43
- </div>
44
- </template>
45
-
46
- <script>
47
- export default {
48
- name: 'ItemColumn',
49
- inject: ['root'],
50
- props: {
51
- column: Object,
52
- task: Object
53
- },
54
- methods: {
55
- emitEvent(eventName, event) {
56
- const eventHandler = this.column.events?.[eventName];
57
- if (eventHandler) {
58
- eventHandler({ event, data: this.task, column: this.column });
59
- }
60
- this.root.$emit(`taskList-${this.task.type}-${eventName}`, { event, data: this.task, column: this.column });
61
- }
62
- },
63
- computed: {
64
- html() {
65
- return this.column.html === true;
66
- },
67
- value() {
68
- return typeof this.column.value === 'function' ? this.column.value(this.task) : this.task[this.column.value];
69
- },
70
- itemColumnStyle() {
71
- return {
72
- ...this.root.style['task-list-item-column'],
73
- ...this.column.style['task-list-item-column'],
74
- width: `${this.column.finalWidth}px`,
75
- height: `${this.column.height}px`
76
- };
77
- },
78
- wrapperStyle() {
79
- return {
80
- ...this.root.style['task-list-item-value-wrapper'],
81
- ...this.column.style['task-list-item-value-wrapper']
82
- };
83
- },
84
- containerStyle() {
85
- return {
86
- ...this.root.style['task-list-item-value-container'],
87
- ...this.column.style['task-list-item-value-container']
88
- };
89
- },
90
- valueStyle() {
91
- return {
92
- ...this.root.style['task-list-item-value'],
93
- ...this.column.style['task-list-item-value']
94
- };
95
- }
96
- }
97
- };
98
- </script>
@@ -1,42 +0,0 @@
1
- <template>
2
- <div
3
- class="gantt-elastic__task-list-wrapper"
4
- ref="taskListWrapper"
5
- :style="{ ...root.style['task-list-wrapper'], width: '100%', height: '100%' }"
6
- v-show="root.state.options.taskList.display"
7
- >
8
- <div class="gantt-elastic__task-list" :style="{ ...root.style['task-list'] }" ref="taskList">
9
- <task-list-header></task-list-header>
10
- <div
11
- class="gantt-elastic__task-list-items"
12
- ref="taskListItems"
13
- :style="{ ...root.style['task-list-items'], height: `${root.state.options.rowsHeight}px` }"
14
- >
15
- <task-list-item
16
- v-for="task in root.visibleTasks"
17
- :key="task.id"
18
- :task="task"
19
- ></task-list-item>
20
- </div>
21
- </div>
22
- </div>
23
- </template>
24
-
25
- <script>
26
- import TaskListHeader from './TaskListHeader.vue';
27
- import TaskListItem from './TaskListItem.vue';
28
-
29
- export default {
30
- name: 'TaskList',
31
- components: {
32
- TaskListHeader,
33
- TaskListItem
34
- },
35
- inject: ['root'],
36
- mounted() {
37
- this.root.state.refs.taskListWrapper = this.$refs.taskListWrapper;
38
- this.root.state.refs.taskList = this.$refs.taskList;
39
- this.root.state.refs.taskListItems = this.$refs.taskListItems;
40
- }
41
- };
42
- </script>
@@ -1,143 +0,0 @@
1
- <template>
2
- <div
3
- class="gantt-elastic__task-list-header"
4
- :style="headerStyle"
5
- >
6
- <div
7
- class="gantt-elastic__task-list-header-column"
8
- v-for="column in root.getTaskListColumns"
9
- :key="column._id"
10
- :style="columnStyle(column)"
11
- >
12
- <task-list-expander
13
- v-if="column.expander"
14
- :tasks="collapsible"
15
- :options="root.state.options.taskList.expander"
16
- ></task-list-expander>
17
- <div
18
- class="gantt-elastic__task-list-header-label"
19
- :style="headerLabelStyle(column)"
20
- :column="column"
21
- @mouseup="resizerMouseUp"
22
- >
23
- {{ column.label }}
24
- </div>
25
- <div
26
- class="gantt-elastic__task-list-header-resizer-wrapper"
27
- :style="resizerWrapperStyle(column)"
28
- :column="column"
29
- @mousedown="resizerMouseDown($event, column)"
30
- >
31
- <div class="gantt-elastic__task-list-header-resizer" :style="resizerStyle(column)">
32
- <div
33
- class="gantt-elastic__task-list-header-resizer-dot"
34
- v-for="dot in 3"
35
- :key="dot"
36
- :style="resizerDotStyle(column)"
37
- ></div>
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
- </template>
43
-
44
- <script>
45
- import TaskListExpander from '../Expander.vue';
46
-
47
- export default {
48
- name: 'TaskListHeader',
49
- components: {
50
- TaskListExpander
51
- },
52
- inject: ['root'],
53
- data() {
54
- return {
55
- resizer: {
56
- moving: false,
57
- x: 0
58
- }
59
- };
60
- },
61
- computed: {
62
- collapsible() {
63
- return this.root.state.tasks.filter(task => task.allChildren.length > 0);
64
- },
65
- headerStyle() {
66
- return {
67
- ...this.root.style['task-list-header'],
68
- height: `${this.root.state.options.calendar.height}px`,
69
- marginBottom: `${this.root.state.options.calendar.gap}px`
70
- };
71
- }
72
- },
73
- methods: {
74
- columnStyle(column) {
75
- return {
76
- ...this.root.style['task-list-header-column'],
77
- ...column.style['task-list-header-column'],
78
- width: `${column.finalWidth}px`
79
- };
80
- },
81
- headerLabelStyle(column) {
82
- return {
83
- ...this.root.style['task-list-header-label'],
84
- ...column.style['task-list-header-label']
85
- };
86
- },
87
- resizerWrapperStyle(column) {
88
- return {
89
- ...this.root.style['task-list-header-resizer-wrapper'],
90
- ...column.style['task-list-header-resizer-wrapper']
91
- };
92
- },
93
- resizerStyle(column) {
94
- return {
95
- ...this.root.style['task-list-header-resizer'],
96
- ...column.style['task-list-header-resizer']
97
- };
98
- },
99
- resizerDotStyle(column) {
100
- return {
101
- ...this.root.style['task-list-header-resizer-dot'],
102
- ...column.style['task-list-header-resizer-dot']
103
- };
104
- },
105
- resizerMouseDown(event, column) {
106
- if (!this.resizer.moving) {
107
- this.resizer.moving = column;
108
- this.resizer.x = event.clientX;
109
- this.resizer.initialWidth = column.width;
110
- this.root.$emit('taskList-column-width-change-start', this.resizer.moving);
111
- }
112
- },
113
- resizerMouseMove(event) {
114
- if (this.resizer.moving) {
115
- const lastWidth = this.resizer.moving.width;
116
- this.resizer.moving.width = this.resizer.initialWidth + event.clientX - this.resizer.x;
117
- if (this.resizer.moving.width < this.root.state.options.taskList.minWidth) {
118
- this.resizer.moving.width = this.root.state.options.taskList.minWidth;
119
- }
120
- if (lastWidth !== this.resizer.moving.width) {
121
- this.root.$emit('taskList-column-width-change', this.resizer.moving);
122
- }
123
- }
124
- },
125
- resizerMouseUp() {
126
- if (this.resizer.moving) {
127
- this.root.$emit('taskList-column-width-change-stop', this.resizer.moving);
128
- this.resizer.moving = false;
129
- }
130
- }
131
- },
132
- created() {
133
- document.addEventListener('mouseup', this.resizerMouseUp);
134
- document.addEventListener('mousemove', this.resizerMouseMove);
135
- this.root.$on('main-view-mousemove', this.resizerMouseMove);
136
- this.root.$on('main-view-mouseup', this.resizerMouseUp);
137
- },
138
- // beforeDestroy() {
139
- // document.removeEventListener('mouseup', this.resizerMouseUp);
140
- // document.removeEventListener('mousemove', this.resizerMouseMove);
141
- // }
142
- };
143
- </script>
@@ -1,39 +0,0 @@
1
- <template>
2
- <div class="gantt-elastic__task-list-item" :style="root.style['task-list-item']">
3
- <item-column
4
- v-for="column in columns"
5
- :key="column._id"
6
- :column="column"
7
- :task="task"
8
- >
9
- <task-list-expander
10
- v-if="column.expander"
11
- :tasks="[task]"
12
- :options="root.state.options.taskList.expander"
13
- type="taskList"
14
- ></task-list-expander>
15
- </item-column>
16
- </div>
17
- </template>
18
-
19
- <script>
20
- import TaskListExpander from '../Expander.vue';
21
- import ItemColumn from './ItemColumn.vue';
22
-
23
- export default {
24
- name: 'TaskListItem',
25
- components: {
26
- TaskListExpander,
27
- ItemColumn
28
- },
29
- inject: ['root'],
30
- props: {
31
- task: Object
32
- },
33
- computed: {
34
- columns() {
35
- return this.root.state.options.taskList.columns;
36
- }
37
- }
38
- };
39
- </script>
@@ -1,28 +0,0 @@
1
-
2
- import Vue from 'vue';
3
- import { mergeDeep } from '../GanttElastic.vue';
4
- import GanttElasticStandalone from '../GanttElastic.standalone.vue';
5
-
6
- window.GanttElastic = {
7
- component: GanttElasticStandalone,
8
- mount(config) {
9
- const ready = typeof config.ready === 'function' ? config.ready : () => { };
10
- const cfg = mergeDeep({}, config);
11
- if (typeof cfg.dynamicStyle === 'undefined') {
12
- cfg.dynamicStyle = {};
13
- }
14
- const ganttElastic = { ...GanttElasticStandalone };
15
- for (let prop in cfg) {
16
- if (['el', 'ready'].includes(prop)) {
17
- continue;
18
- }
19
- if (typeof ganttElastic[prop] !== 'undefined') {
20
- ganttElastic[prop] = { ...ganttElastic[prop], ...cfg[prop] };
21
- continue;
22
- }
23
- ganttElastic[prop] = cfg[prop];
24
- }
25
- return new Vue(ganttElastic).$on('gantt-elastic-ready', ready).$mount(cfg.el);
26
- }
27
- };
28
- export default GanttElasticStandalone;
package/src/index.js DELETED
@@ -1,13 +0,0 @@
1
-
2
-
3
- import ganttChart from './components/GanttElastic.standalone.vue';
4
- export default {
5
- install(app, options = {}) {
6
- app.component('tg-ganttchart', ganttChart);
7
- },
8
- };
9
- // if (typeof window !== 'undefined' && window.Vue) {
10
- // window.Vue.use(TgList);
11
- // }
12
-
13
- export { ganttChart };
package/vue.config.js DELETED
@@ -1,42 +0,0 @@
1
- const path = require('path');
2
- const Dotenv = require('dotenv-webpack');
3
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
4
- const isBundleAnalyze = false;
5
- module.exports = {
6
- lintOnSave: false,
7
- filenameHashing: false,
8
- configureWebpack: {
9
- entry:'./src/index.js',
10
- resolve: {
11
- extensions: ['.js', '.vue'],
12
- alias: {
13
- 'vue$': 'vue/dist/vue.esm.js',
14
- '@': path.resolve(__dirname, 'src')
15
- }
16
- },
17
- output: {
18
- filename:(format)=>`index.${format}.js`,
19
- path: path.resolve(__dirname, 'dist'),
20
- },
21
- performance:{
22
- hints: false,
23
- maxEntrypointSize: 512000,
24
- maxAssetSize: 512000
25
- },
26
- plugins: [
27
- new Dotenv(),
28
- ...isBundleAnalyze ? [ new BundleAnalyzerPlugin() ] : []
29
- ],
30
- module: {
31
- rules: [
32
- {
33
- test: /\.mjs$/,
34
- include: /node_modules/,
35
- type: "javascript/auto",
36
- use: [],
37
- }
38
- ]
39
- }
40
- },
41
- };
42
-