vue-picker icon indicating copy to clipboard operation
vue-picker copied to clipboard

sourcesContent const 旧版本浏览器不支持

Open wangh1998 opened this issue 4 years ago • 2 comments

image

wangh1998 avatar Apr 25 '21 12:04 wangh1998

修改打包配置 rollup.config.js

import vue from "rollup-plugin-vue";
import autoprefixer from "autoprefixer";
import precss from "precss";
import babel from "@rollup/plugin-babel";
export default [
  {
    input: "./src/index.vue",
    output: {
      format: "esm",
      file: "dist/picker.esm.js",
      sourceMap: false
    },
    plugins: [
      vue({
        style: {
          postcssPlugins: [precss(), autoprefixer()]
        },
        needMap: false
      }),
      babel({
        exclude: "node_modules/**",
        extensions: [".js", ".ts", ".tsx", ".vue"],
        babelHelpers: "bundled"
      })
    ]
  }
];

根目录增加 babel.config.json

{
  "presets": ["@babel/preset-env"]
}

运行 1 npm run rollup 2 npm run build

得到新的vue-picker.js

tabooc avatar Sep 30 '21 03:09 tabooc

尝试可用。 目前自己的解决办法是将vue-picker.js,图示部分const变为var。

wangh1998 avatar Sep 30 '21 03:09 wangh1998