ElemeFE / page-skeleton-webpack-plugin

Webpack plugin to generate the skeleton page automatically
MIT License
2.8k stars 393 forks source link

TypeError: generate is not a function #28

Open weihongyu12 opened 6 years ago

weihongyu12 commented 6 years ago

Description

The page-skeleton-webpack-plugin was installed and configured using the project generated by the @vue/cli 3.0 scaffold, but the skeleton screen could not be generated when the project was run.

使用@vue/cli 3.0脚手架生成的项目,安装并配置了page-skeleton-webpack-plugin,但是在运行项目时无法生成skeleton screen

Steps to reproduce

  1. Generate project using vue/cli 3.0
  2. Install page-skeleton-webpack-plugin and configure it in vue.config.js
  3. Execute npm run serve to run the project
  4. Open the console and click on Preview skeleton page
  5. An error has occurred 😭 -> "[PSG] generate is not a function"

-

  1. 使用vue/cli 3.0生成项目
  2. 安装page-skeleton-webpack-plugin,并在vue.config.js进行相应的配置
  3. 执行npm run serve运行项目
  4. 打开控制台,点击Preview skeleton page
  5. 出现错误😭 -> "[PSG] generate is not a function"

Expected behavior:

Correct generation of skeleton screen.

正确的生成skeleton screen

Actual behavior:

An error message 😭 -> "[PSG] generate is not a function" has occurred and the debug skeleton screen cannot be previewed.

出现了错误提示😭 -> "[PSG] generate is not a function",无法预览调试skeleton screen

image

Plugin configration

const path = require('path');
const { SkeletonPlugin } = require('page-skeleton-webpack-plugin');

module.exports = {
  crossorigin: 'anonymous',
  integrity: true,
  configureWebpack: {
    plugins: [
      new SkeletonPlugin({
        pathname: path.resolve(__dirname, './shell'),
        staticDir: path.resolve(__dirname, './dist'),
        routes: ['/'],
      }),
    ],
  },
};

Versions

seveny commented 6 years ago

一样的环境,一样的问题

lentoo commented 6 years ago

一样的环境,一样的问题

panct commented 5 years ago

image

我也是同样的问题

gbyuxia commented 5 years ago

我也碰到了,难道cli3还不支持吗?

neoma077 commented 5 years ago

解决了么??

jonelovemira commented 5 years ago

css-tree版本太低,升级一下 npm i css-tree@1.0.0-alpha.29 就可以了