JSPM

sgf7-import-plugin

1.0.1-rc.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q22789F
    • License ISC

    import f7 on demand

    Package Exports

    • sgf7-import-plugin

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sgf7-import-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    sgh5-import-plugin

    typescript import framework7 on demand. help that import css file.

    Requirements

    framework7@5

    Usage

    npm i sgh5-import-plugin -D

    Import global styles:

    import "framework7/framework7.less"

    Using plugin:

    // webapck.config.js
    const { createTransformFactory } = require("ts-import-f7-plugin");
    module.exports = {
        // ...
        {
            test: /\.tsx?$/,
            use: [
                {
                loader: "awesome-typescript-loader", // or ts-loader
                options: {
                    getCustomTransformers: (program) => ({
                        before: [createTransformFactory({
                          ignoreImportNames: [] // jump some import names, option
                        })],
                    }),
                },
                },
            ],
        },
        // ...
    }

    before:

    import { f7Input } from "@/lib/framework7/vue/framework7-vue.esm";
    import DialogComponent, {
      Dialog,
    } from "framework7/components/dialog/dialog";
      // ...
      this.$f7ready(async (f7) => {
        await f7.loadModules(DialogComponent);
      })
      // ...

    after:

    import { f7Input } from "framework7-vue";
    import DialogComponent, {
      Dialog,
    } from "framework7/components/dialog/dialog";
    
    import "framework7/components/input.css";
    import "framework7/components/dialog.css";
      // ...
      this.$f7ready(async (f7) => {
        await f7.loadModules(DialogComponent);
      })
      // ...