Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 45cec79

Browse files
authored
Merge pull request #154 from alvarosaburido/feature/add-aliases-to-rollup
feat(build): add alias to rollup
2 parents f610580 + b1afc25 commit 45cec79

File tree

13 files changed

+36
-22
lines changed

13 files changed

+36
-22
lines changed

dev/typescript/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ import {
6060
pattern,
6161
ColorInput,
6262
NumberInput,
63-
} from '../../src';
64-
/* } from '../../dist/as-dynamic-forms.esm'; */
63+
/* } from '../../src'; */
64+
} from '../../dist/as-dynamic-forms.esm';
6565
export default defineComponent({
6666
name: 'app',
6767
setup() {

dev/typescript/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { createApp } from 'vue';
33
import App from './App.vue';
44
import './styles/main.scss';
55

6-
import { createDynamicForms } from '../../src';
6+
// import { createDynamicForms } from '../../src';
77

8-
// import { createDynamicForms } from '../../dist/as-dynamic-forms.esm';
8+
import { createDynamicForms } from '../../dist/as-dynamic-forms.esm';
99

1010
const VueDynamicForms = createDynamicForms({
1111
autoValidate: true,

package-lock.json

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
},
5353
"devDependencies": {
5454
"@microsoft/api-extractor": "^7.10.1",
55+
"@rollup/plugin-alias": "^3.1.1",
5556
"@rollup/plugin-buble": "^0.21.3",
5657
"@rollup/plugin-commonjs": "^15.1.0",
5758
"@rollup/plugin-node-resolve": "^9.0.0",

rollup.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import commonjs from '@rollup/plugin-commonjs';
77
import { terser } from 'rollup-plugin-terser';
88
import ts from 'rollup-plugin-typescript2';
99
import vue from 'rollup-plugin-vue';
10+
import alias from '@rollup/plugin-alias';
1011

1112
import pkg from './package.json';
1213
const name = 'as-dynamic-forms';
@@ -89,6 +90,9 @@ function createConfig(format, output, plugins = []) {
8990
// used alone.
9091
external,
9192
plugins: [
93+
alias({
94+
entries: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
95+
}),
9296
tsPlugin,
9397
vue(),
9498
createReplacePlugin(

src/components/checkbox-input/CheckboxInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { defineComponent, h, PropType } from 'vue';
3-
import { FormControl, CheckboxInput } from '../../core/models';
4-
import { useInputEvents } from '../../composables/input-events';
3+
import { FormControl, CheckboxInput } from '@/core/models';
4+
import { useInputEvents } from '@/composables/input-events';
55
66
const props = {
77
control: Object as PropType<FormControl<CheckboxInput>>,

src/components/dynamic-form/DynamicForm.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ import {
4949
import { DynamicForm } from './form';
5050
import DynamicInput from '../dynamic-input/DynamicInput.vue';
5151
52-
import { InputBase, FormControl } from '../../core/models';
53-
import { dynamicFormsSymbol } from '../../useApi';
52+
import { InputBase, FormControl } from '@/core/models';
53+
import { dynamicFormsSymbol } from '@/useApi';
5454
/* import { warn } from '../../core/utils/warning';
5555
*/
5656
const props = {

src/components/dynamic-input/DynamicInput.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import {
2121
RadioInput,
2222
CheckboxInput,
2323
TextAreaInput,
24-
} from '../../core/models';
24+
} from '@/core/models';
2525
26-
import { isEmpty, entries, values, keys } from '../../core/utils/helpers';
27-
import { useInputEvents } from '../../composables/input-events';
28-
import { dynamicFormsSymbol } from '../../useApi';
26+
import { isEmpty, entries, values, keys } from '@/core/utils/helpers';
27+
import { useInputEvents } from '@/composables/input-events';
28+
import { dynamicFormsSymbol } from '@/useApi';
2929
3030
const components = {
3131
TextInputComponent,

src/components/number-input/NumberInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { defineComponent, h, PropType } from 'vue';
3-
import { FormControl, NumberInput } from '../../core/models';
4-
import { useInputEvents } from '../../composables/input-events';
3+
import { FormControl, NumberInput } from '@/core/models';
4+
import { useInputEvents } from '@/composables/input-events';
55
66
const props = {
77
control: Object as PropType<FormControl<NumberInput>>,

src/components/radio-input/RadioInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { defineComponent, h, PropType } from 'vue';
3-
import { FormControl, RadioInput } from '../../core/models';
4-
import { useInputEvents } from '../../composables/input-events';
3+
import { FormControl, RadioInput } from '@/core/models';
4+
import { useInputEvents } from '@/composables/input-events';
55
66
const props = {
77
control: Object as PropType<FormControl<RadioInput>>,

src/components/select-input/SelectInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { defineComponent, h, PropType } from 'vue';
3-
import { FormControl, SelectInput } from '../../core/models';
4-
import { useInputEvents } from '../../composables/input-events';
3+
import { FormControl, SelectInput } from '@/core/models';
4+
import { useInputEvents } from '@/composables/input-events';
55
66
const props = {
77
control: Object as PropType<FormControl<SelectInput>>,

src/components/text-area-input/TextAreaInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { defineComponent, h, PropType } from 'vue';
3-
import { FormControl, TextAreaInput } from '../../core/models';
4-
import { useInputEvents } from '../../composables/input-events';
3+
import { FormControl, TextAreaInput } from '@/core/models';
4+
import { useInputEvents } from '@/composables/input-events';
55
const props = {
66
control: Object as PropType<FormControl<TextAreaInput>>,
77
};

src/components/text-input/TextInput.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
PasswordInput,
88
TextInput,
99
UrlInput,
10-
} from '../../core/models';
11-
import { useInputEvents } from '../../composables/input-events';
10+
} from '@/core/models';
11+
import { useInputEvents } from '@/composables/input-events';
1212
1313
const props = {
1414
control: Object as PropType<

0 commit comments

Comments
 (0)