uiwjs / uiw

⚛️ @uiwjs A high quality UI Toolkit, A Component Library for React 16+.
https://uiwjs.github.io
MIT License
714 stars 120 forks source link

我本地 引用你这个uiw 说找不到模块是什么原因? #56

Closed w3cui closed 6 years ago

w3cui commented 6 years ago

错误信息

ERROR in ./src/Module/index.jsx
Module not found: Error: Can't resolve 'uiw' in 'G:\github\react\react-practice\react-dome\src\Module'
 @ ./src/Module/index.jsx 15:11-25
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

引用代码:

import React from 'react';
import { Router, Route, Link } from 'react-router';
import { Button } from 'uiw';
import Header from './Common/header';

class App extends React.Component {
  constructor(props){
    super(props);
    this.getAttribute = function(){};
    this.logo = "http:\//ww4.sinaimg.cn/thumb180/0069kQGBgy1foaj1sj8grj32c0340e81.jpg";
  };
  render() {
    return (
      <div>
       <Header></Header>
        <Button></Button>
        <div className="App-header">
          <img src={this.logo} className="App-logo" alt="logo" />
          <h1 className="App-title">Welcome to React</h1>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        {this.props.children}
      </div>
    );
  }
} 
export default App;

引用步骤:

cnpm install uiw --save

jaywcjlove commented 6 years ago

@w3cui 你尝试清空 node_modules,使用 npm 安装 uiw@1.7.0

w3cui commented 6 years ago
./node_modules/_uiw@1.7.0@uiw/lib/list/style/index.less Module parse failed: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type. @List:~"w-list";
.@{List} {

@ ./node_modules/_uiw@1.7.0@uiw/lib/list/List.js 33:0-29 @ ./node_modules/_uiw@1.7.0@uiw/lib/list/index.js @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js @ ./src/Module/index.jsx @ ./src/Routes/routes.jsx @ ./src/main.jsx @ multi ./src/main.jsx

好像能读取到了,但是报这个@符合的错! 我webpack里面@符号是定义的项目根目录是不是有影响?

w3cui commented 6 years ago

我的webpack 里面配置了: ` resolve: { // 解析模块请求的选项 // (不适用于对 loader 解析)

    modules: [
        "node_modules",
        path.resolve(__dirname, "app")
    ],
    // 用于查找模块的目录

    extensions: [".js", ".json", ".jsx", ".css"],
    // 使用的扩展名

    alias: {
        // 模块别名列表

        "@": APP_DIR
        // 起别名:"module" -> "new-module" 和 "module/path/file" -> "new-module/path/file"

    }
},`

是不是有影响?

jaywcjlove commented 6 years ago

@w3cui 你要在webpack中配置 less 解析

{
  test: /\.(css|less)$/,
  use: [
    require.resolve('style-loader'),
    {
      loader: require.resolve('css-loader'),
      options: {
        modules: true,
        localIdentName: '[name]-[hash:base64:5]',
        importLoaders: 1,
      },
    },
    {
      loader: require.resolve('postcss-loader'),
      options: {
        ident: 'postcss', // https://webpack.js.org/guides/migrating/#complex-options
        plugins: () => [
          require('postcss-flexbugs-fixes'),
          autoprefixer({
            browsers: [
              '>1%',
              'last 4 versions',
              'Firefox ESR',
            ],
            flexbox: 'no-2009',
          }),
          px2rem({
            rootValue: 100,
            selectorBlackList: ['html']
          })
        ],
      },
    },
    require.resolve('less-loader'),
  ]
}
w3cui commented 6 years ago

@jaywcjlove

我这个配置了的我项目里面自己写的less

都能解析 这是我的配置需要怎么去修改?

module: { rules: [{ test: /\.js[x]?$/, use: [{ loader: "babel-loader", }] }, { test: /\.html$/, loader: 'html-loader' }, { test: /\.js$/, loader: 'babel-loader', include: [ APP_DIR ] }, { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?modules' }), include: [ APP_DIR ] }, { test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?!less-loader' }), include: [ APP_DIR ] }, { test: /\.sass$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader?!sass-loader' }), include: [ APP_DIR ] }, { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader', options: { limit: 10000, name: 'img/[name].[hash:7].[ext]' } }, { test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: 'media/[name].[hash:7].[ext]' } }, ] }

jaywcjlove commented 6 years ago

@w3cui sass 跟 less 冲突了?这个应该不可能的事情

w3cui commented 6 years ago

我把sass清除了一样的还是报错!

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/list/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @List:~"w-list";
|
| .@{List} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/list/List.js 33:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/list/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/copy-to-clipboard/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @copy-to-clipboard:~"w-copy-to-clipboard";
|
| .@{copy-to-clipboard} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/copy-to-clipboard/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/form/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @form-cls: ~"w-form";
| @form-item-cls: ~"@{form-cls}-item";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/form/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/upload/style/dragger.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/upload/Dragger.js 33:0-31
 @ ./node_modules/_uiw@1.7.0@uiw/lib/upload/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/button/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/button/Button.js 33:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/button/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/radio/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/radio/index.js 19:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/checkbox/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/checkbox/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/card/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/card/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/tag/style/tag-group.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tag/TagGroup.js 41:0-33
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tag/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/notification/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/notification/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/breadcrumb/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/breadcrumb/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/heat-map/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/heat-map/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/input-number/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/input-number/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/input/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/input/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/menu/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/menu/index.js 27:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/loading/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/loading/index.js 25:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/button/style/buttons-group.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/button/ButtonGroup.js 33:0-37
 @ ./node_modules/_uiw@1.7.0@uiw/lib/button/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/table/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/table/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/tag/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tag/Tag.js 37:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tag/index.js
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/paging/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/paging/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/select/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/select/index.js 19:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/switch/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/switch/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/alert/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/alert/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/message/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| .w-message {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/message/index.js 26:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/tooltip/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| .w-tooltip {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tooltip/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/layout/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @import "./row.less";
 @ ./node_modules/_uiw@1.7.0@uiw/lib/layout/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/date-picker/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @import './time-select.less';
 @ ./node_modules/_uiw@1.7.0@uiw/lib/date-picker/index.js 30:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/modal/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
| @w-modal:~"w-modal";
 @ ./node_modules/_uiw@1.7.0@uiw/lib/modal/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/tabs/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "../../style/variables.less";
| @w-tabs:~'w-tabs';
| .@{w-tabs} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tabs/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/icon/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "~uiw-iconfont/fonts/w-iconfont.css";
| .w-icon-spin:before {
|   animation: loading-circle 1s infinite linear;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/icon/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/steps/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @stepsPrefixClass:~"w-steps";
|
| .@{stepsPrefixClass} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/steps/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/timestamp/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @timestamp:~"w-timestamp";
|
| .@{timestamp} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/timestamp/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/affix/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-affix:~"w-affix";
|
| // .@{w-affix}{
 @ ./node_modules/_uiw@1.7.0@uiw/lib/affix/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/badge/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-badge:~"w-badge";
| .@{w-badge} {
|   position: relative;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/badge/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/calendar/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-calendar:~"w-calendar";
|
| .@{w-calendar} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/calendar/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/collapse/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-collapse: ~'w-collapse';
|
| .@{w-collapse} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/collapse/index.js 15:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/divider/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-divider:~"w-divider";
|
| .@{w-divider} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/divider/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/dropdown/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-dropdown:~"w-dropdown";
|
| .@{w-dropdown} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/dropdown/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/progress/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-progress-prefix: ~"w-progress";
|
| .@{w-progress-prefix} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/progress/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/rate/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-rate:~"w-rate";
| .@{w-rate} {
|   list-style: none;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/rate/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/tree/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @w-tree:~"w-tree";
|
| .@{w-tree} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/tree/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/avatar/style/index.less
Module parse failed: Unexpected character '@' (2:0)
You may need an appropriate loader to handle this file type.
|
| @avatar-prefix-cls: ~"w-avatar";
|
| .@{avatar-prefix-cls} {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/avatar/index.js 37:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/carousel/style/index.less
Module parse failed: Unexpected character '@' (4:0)
You may need an appropriate loader to handle this file type.
| /*@import "~slick-carousel/slick/slick-theme.css";*/
|
| @import "../../style/variables.less";
| @import "../../style/mixins/index.less";
|
 @ ./node_modules/_uiw@1.7.0@uiw/lib/carousel/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/transition/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-animate {
|   transition: all 0.3s ease;
|   &.is-down {
 @ ./node_modules/_uiw@1.7.0@uiw/lib/transition/index.js 41:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/back-top/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-back-top {
|   display: inline-block;
|   transition: opacity 0.2s linear 0s, visibility;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/back-top/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/input-password/style/index.less
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| .w-input-password.password-show.w-input-icon {
|   .event {
|     color: #0fa120;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/input-password/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx

ERROR in ./node_modules/_uiw@1.7.0@uiw/lib/slider/style/index.less
Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
| .w-slider {
|   width: 100%;
|   height: 4px;
 @ ./node_modules/_uiw@1.7.0@uiw/lib/slider/index.js 11:0-29
 @ ./node_modules/_uiw@1.7.0@uiw/lib/index.js
 @ ./src/Module/index.jsx
 @ ./src/Routes/routes.jsx
 @ ./src/main.jsx
 @ multi ./src/main.jsx
jaywcjlove commented 6 years ago

@w3cui 你的loader这样配置配置试一试?

{
    test: /\.(css|less)$/,
    use:[ 'style-loader','css-loader','less-loader'],
},
w3cui commented 6 years ago

现在成功了!! 谢谢。。。 我想问一下: 我之前的写法怎么在我的项目里面写less就可以,导入uiw 后就报解析错误,这个是什么原因造成的??

jaywcjlove commented 6 years ago

@w3cui 你的配置方法好像是 webpack1 or 2 遗留下的配置方法,可能是新的 less-loader 不兼容老的配置方法。

w3cui commented 6 years ago

嗯! 好的

jaywcjlove commented 6 years ago

两个实例

https://github.com/uiw-react/uiw-example-create-react-app
https://github.com/uiw-react/uiw-example-parcel