Skip to content

Add Ionic 5 support fixes #108 #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Apart from minor improvements and further testing of various mixes of Ionic comp
| Import controllers directly | :heavy_check_mark: | [Pending](https://github.com/ionic-team/ionic/pull/19573) | Improve treeshaking and sync with react and angular implementations |
| Unit tests | :x: | :x: | Outdated as were originally written in plain JS, need to be updated for TS |

## Ionic versions 4 and 5
:warning: Moving forward all versions of `ionic-vue` will be supporting Ionic 5 only, if you'd like to continue using Ionic 4 please use `ionic-vue` version `1.3.4`

## Installing / Getting started

A quick introduction of the minimal setup you need to get a hello world up and running.
Expand Down Expand Up @@ -93,7 +96,6 @@ IonicVueRouter requires `ion-vue-router` element in order to render Ionic transi
### IonicVue

`IonicVue` abstracts DOM interaction of Ionic UI components inside a Vue application.
:warning: Use of `this.$ionic` or `Vue.$ionic` is deprecated and will be removed in the near future. Please use the example below instead:

```js
import { alertController } from '@ionic/vue';
Expand Down
70 changes: 35 additions & 35 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
import path from 'path'
import vue from 'rollup-plugin-vue'
import { terser } from 'rollup-plugin-terser'
import typescript from 'rollup-plugin-typescript2'
import { version as packageVersion } from '../package.json'
import path from "path";
import vue from "rollup-plugin-vue";
import { terser } from "rollup-plugin-terser";
import typescript from "rollup-plugin-typescript2";
import { version as packageVersion } from "../package.json";

const resolve = _path => path.resolve(__dirname, '../', _path)
const version = process.env.VERSION || packageVersion
const resolve = _path => path.resolve(__dirname, "../", _path);
const version = process.env.VERSION || packageVersion;
const banner = `/*!
* @modus/ionic-vue v${version}
* ${new Date().getFullYear()} Michael Tintiuc - Modus Create
* @license MIT
*/
`
`;

function outputConfig(suffix, format, opts = {}) {
return Object.assign(
{
file: resolve(`./dist/ionic-vue${suffix}.js`),
name: 'IonicVue',
exports: 'named',
name: "IonicVue",
exports: "named",
sourcemap: true,
format,
banner,
banner
},
opts
)
);
}

function baseConfig() {
return {
input: resolve('./src/index.ts'),
input: resolve("./src/index.ts"),
output: [
outputConfig('', 'umd', {
outputConfig("", "umd", {
globals: {
vue: 'Vue',
},
vue: "Vue"
}
}),
outputConfig('.esm', 'esm'),
outputConfig('.common', 'cjs'),
outputConfig(".esm", "esm"),
outputConfig(".common", "cjs")
],
external: [
'vue',
'vue-router',
'@ionic/core',
'@ionic/core/loader',
'ionicons',
'ionicons/icons',
"vue",
"vue-router",
"@ionic/core",
"@ionic/core/loader",
"ionicons",
"ionicons/icons"
],
plugins: [
vue(),
typescript({
useTsconfigDeclarationDir: true,
objectHashIgnoreUnknownHack: true,
objectHashIgnoreUnknownHack: false,
clean: true
})
],
}
]
};
}

export default args => {
const configs = [baseConfig()]
const configs = [baseConfig()];

if (args.configProd === true) {
const prodConfig = baseConfig()
prodConfig.plugins.push(terser())
const prodConfig = baseConfig();
prodConfig.plugins.push(terser());

for (const item of prodConfig.output) {
item.file = item.file.replace('.js', '.min.js')
item.sourcemap = false
item.file = item.file.replace(".js", ".min.js");
item.sourcemap = false;
}

configs.push(prodConfig)
configs.push(prodConfig);
}

return configs
}
return configs;
};
Loading