Skip to content

Commit 19202db

Browse files
committed
Added tests & builds
1 parent 65da90b commit 19202db

26 files changed

+14437
-11496
lines changed

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

build/rollup.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import commonjs from '@rollup/plugin-commonjs' // Convert CommonJS modules to ES6
2+
import buble from '@rollup/plugin-buble' // Transpile/polyfill with reasonable browser support
3+
import autoExternal from 'rollup-plugin-auto-external'
4+
import vue from 'rollup-plugin-vue' // Handle .vue SFC files
5+
import { terser } from 'rollup-plugin-terser'
6+
7+
export default {
8+
input: 'src/index.js',
9+
output: [
10+
{
11+
name: 'VueFormulateExtended',
12+
globals: {
13+
'@braid/vue-formulate': 'VueFormulate',
14+
},
15+
sourcemap: false,
16+
},
17+
],
18+
external: [],
19+
plugins: [
20+
commonjs(),
21+
autoExternal(),
22+
vue({
23+
compileTemplate: true,
24+
}),
25+
buble({
26+
objectAssign: 'Object.assign',
27+
transforms: {
28+
forOf: false,
29+
},
30+
}), // Transpile to ES5,
31+
terser(),
32+
],
33+
}

build/rollup.iife.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import resolve from '@rollup/plugin-node-resolve'
2+
import commonjs from '@rollup/plugin-commonjs' // Convert CommonJS modules to ES6
3+
import buble from '@rollup/plugin-buble' // Transpile/polyfill with reasonable browser support
4+
import vue from 'rollup-plugin-vue' // Handle .vue SFC files
5+
import internal from 'rollup-plugin-internal'
6+
import { terser } from 'rollup-plugin-terser'
7+
8+
export default {
9+
input: 'src/index.js', // Path relative to package.json
10+
output: {
11+
name: 'VueFormulateExtended',
12+
format: 'iife',
13+
globals: {
14+
'@braid/vue-formulate': 'VueFormulate',
15+
},
16+
},
17+
plugins: [
18+
resolve({
19+
browser: true,
20+
preferBuiltins: false,
21+
}),
22+
commonjs(),
23+
internal([]),
24+
vue({
25+
compileTemplate: true, // Explicitly convert template to render function
26+
}),
27+
buble({
28+
objectAssign: 'Object.assign',
29+
transforms: {
30+
forOf: false,
31+
},
32+
}), // Transpile to ES5,
33+
terser(),
34+
],
35+
}

example/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Vue.use(VueFormulate, {
1212
features: {
1313
formEvents: true,
1414
textMask: true,
15-
numberField: true,
15+
enforceNumber: true,
1616
},
1717
}),
1818
],

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
preset: '@vue/cli-plugin-unit-jest',
3+
"transformIgnorePatterns": [
4+
"node_modules/(?!@braid)"
5+
]
6+
}

0 commit comments

Comments
 (0)