diff --git a/packages/examples-app/index.html b/packages/examples-app/index.html index 8ca18737e..75c9e2bf7 100644 --- a/packages/examples-app/index.html +++ b/packages/examples-app/index.html @@ -13,6 +13,7 @@

JSON Forms Examples

  • React Vanilla Renderers
  • React Material Renderers
  • Angular Material Renderers
  • +
  • Vue Vanilla Renderers
  • \ No newline at end of file diff --git a/packages/examples-app/prepare-examples-app.js b/packages/examples-app/prepare-examples-app.js index 89ab89b3d..3db3b1ed8 100644 --- a/packages/examples-app/prepare-examples-app.js +++ b/packages/examples-app/prepare-examples-app.js @@ -13,7 +13,8 @@ const packagesDir = join(__dirname, '..'); const examples = { 'react-vanilla': join(packagesDir, 'vanilla-renderers', 'example', 'dist'), 'react-material': join(packagesDir, 'material-renderers', 'example', 'dist'), - 'angular-material': join(packagesDir, 'angular-material', 'example', 'dist') + 'angular-material': join(packagesDir, 'angular-material', 'example', 'dist'), + 'vue-vanilla': join(packagesDir, 'vue', 'vue-vanilla', 'example', 'dist') } // Clean and recreate dist dir diff --git a/packages/vue/vue-vanilla/example/index.bundled.html b/packages/vue/vue-vanilla/example/index.bundled.html new file mode 100644 index 000000000..6f3490282 --- /dev/null +++ b/packages/vue/vue-vanilla/example/index.bundled.html @@ -0,0 +1,16 @@ + + + + + + JSON Forms Vue Vanilla RendererSet + + + + + +
    + + + + \ No newline at end of file diff --git a/packages/vue/vue-vanilla/package.json b/packages/vue/vue-vanilla/package.json index ee8fa649e..02584c6e1 100644 --- a/packages/vue/vue-vanilla/package.json +++ b/packages/vue/vue-vanilla/package.json @@ -44,7 +44,8 @@ "build:do": "cross-env NODE_ENV=production rollup --config rollup.config.js", "build": "run-s --continue-on-error build:pre build:do build:after", "build:after": "symlink-dir ../../core ../vue/node_modules/@jsonforms/core", - "clean": "rimraf lib", + "build:examples-app": "rollup -c rollup.example.config.js", + "clean": "rimraf lib example/dist", "doc": "typedoc --name 'JSON Forms Vue Vanilla Renderers' --mode file --out docs src --ignoreCompilerErrors", "test": "vue-cli-service test:unit" }, diff --git a/packages/vue/vue-vanilla/rollup.example.config.js b/packages/vue/vue-vanilla/rollup.example.config.js new file mode 100644 index 000000000..99f88d83a --- /dev/null +++ b/packages/vue/vue-vanilla/rollup.example.config.js @@ -0,0 +1,52 @@ +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import nodeResolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import copy from 'rollup-plugin-copy'; +import css from 'rollup-plugin-import-css'; +import typescript from 'rollup-plugin-typescript2'; +import vue from 'rollup-plugin-vue'; + +/** + * @type {import('rollup').RollupOptions} +*/ +const config = { + input: 'dev/serve.ts', + output: { + file: 'example/dist/bundle.js', + format: 'iife', + sourcemap: true + }, + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify('production'), + preventAssignment: true, // recommended to be set by library to be forward compatible + }), + vue(), + nodeResolve({ browser: true }), + // Transform mixed because some JsonForms modules use import and require + commonjs({ transformMixedEsModules: true }), + css(), + json(), + typescript({ + tsconfigOverride: { + include: null, + compilerOptions: { + // Do not emit typescript declarations for our bundled example app + declaration: false + } + } + }), + copy({ + targets: [ + { + src: 'example/index.bundled.html', + dest: 'example/dist', + rename: () => 'index.html' + }, + ] + }), + ] +} + +export default config; \ No newline at end of file