(作废)整合react-weui时报错

来源:3-11 使用 Babel 处理 ES6 语法(1)

慕神0028795

2019-03-21

.babelrc配置

{
  "presets": [
    ["@babel/preset-env", { "useBuiltIns": "entry" }],
    "@babel/preset-react"
  ]
}

报错如下:

C:UsersAdministratorDesktopdemo
ode_modules_weui@1.1.0@weuidiststyleweui.css:6
html {
     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
[nodemon] app crashed - waiting for file changes before starting...

webpack is watching the files…


With `useBuiltIns` option, required direct setting of `corejs` option
写回答

1回答

Dell

2019-03-21

0
2
慕神0028795
代码中import时出错 import "weui"; import 'react-weui/build/packages/react-weui.css';
2019-03-22
共2条回复

从基础到实战 手把手带你掌握新版Webpack4.0

知识点+项目实例+原理讲解 全方位解析Webpack4新版本

3627 学习 · 1291 问题

查看课程