From 713a2bab51eedb8bf2926793e8448f3c608dd19e Mon Sep 17 00:00:00 2001 From: Zaytsev Kirill Date: Sun, 11 Oct 2020 11:41:32 +0300 Subject: [PATCH] chore: Build config fixes, modules paths correction --- build/rollup.config.js | 37 ++++++++++++++-------------- build/rollup.iife.config.js | 19 ++++++++------ examples/main.js | 2 +- package.json | 4 ++- src/Formulario.ts | 24 ++++++++---------- src/RuleValidationMessages.ts | 2 +- src/common.types.ts | 1 - src/index.ts | 3 +++ src/shims-ext.d.ts | 3 +-- test/unit/Formulario.test.js | 2 +- test/unit/FormularioForm.test.js | 2 +- test/unit/FormularioGrouping.test.js | 2 +- test/unit/FormularioInput.test.js | 2 +- tsconfig.json | 5 ++-- yarn.lock | 32 +++++++++++++++++++++--- 15 files changed, 84 insertions(+), 56 deletions(-) create mode 100644 src/index.ts diff --git a/build/rollup.config.js b/build/rollup.config.js index 904f255..5fd17aa 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,34 +1,35 @@ -import commonjs from '@rollup/plugin-commonjs' // Convert CommonJS modules to ES6 -import buble from '@rollup/plugin-buble' // Transpile/polyfill with reasonable browser support import autoExternal from 'rollup-plugin-auto-external' -import vue from 'rollup-plugin-vue' // Handle .vue SFC files +import buble from '@rollup/plugin-buble' // Transpile/polyfill with reasonable browser support +import commonjs from '@rollup/plugin-commonjs' // Convert CommonJS modules to ES6 import { terser } from 'rollup-plugin-terser' +import typescript from '@rollup/plugin-typescript' +import vue from 'rollup-plugin-vue' +// noinspection JSUnusedGlobalSymbols export default { - input: 'src/Formulario.js', // Path relative to package.json - output: [ - { - name: 'Formulario', - exports: 'default', - globals: { - 'is-plain-object': 'isPlainObject', - 'nanoid/non-secure': 'nanoid', - 'is-url': 'isUrl', - }, - sourcemap: false - } - ], + input: 'src/index.ts', + output: [{ + name: 'Formulario', + exports: 'default', + globals: { + 'is-plain-object': 'isPlainObject', + 'is-url': 'isUrl', + 'nanoid/non-secure': 'nanoid', + }, + sourcemap: false, + }], external: ['nanoid/non-secure'], plugins: [ commonjs(), autoExternal(), + typescript({ sourceMap: false }), vue({ css: true, // Dynamically inject css as a