uniapp-import-loader

    1.0.2 • Public • Published

    uniapp-import-loader

    uniapp import on demand loader 解决uniapp发布为npm包时组件与页面都使用TS装饰器写时无法成功编译组件的问题。

    $ yarn add uniapp-import-loader
    // vue.config.js
    const path = require("path");
    
    module.exports = {
        configureWebpack: {
            // ...
            module: {
                rules: [
                    {
                        test: /\.vue$/,
                        loader: "uniapp-import-loader", 
                        // import { CCard } from "shst-campus"; 
                        // => import CCard from "shst-campus/lib/c-card/c-card";
                        options: {
                            name: "shst-campus",
                            path: "lib",
                        },
                    },
                ],
            },
            // ..
        },
    };

    Keywords

    none

    Install

    npm i uniapp-import-loader

    DownloadsWeekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    27.2 kB

    Total Files

    13

    Last publish

    Collaborators

    • touchczy