【发布时间】:2016-04-29 08:32:26
【问题描述】:
我有一个基本的单页 React/Redux 应用程序,我正在使用 Webpack 捆绑该应用程序,除了在我尝试加载 materialise-css js 文件时出现以下错误外,一切正常。我试过从 NPM 模块加载,编译源和错误是一样的。
WARNING in ./~/jQuery/dist/jquery.js
There is another module with an equal name when case is ignored.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Rename module if multiple modules are expected or use equal casing if one module is expected.
WARNING in ./~/jquery/dist/jquery.js
There is another module with an equal name when case is ignored.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Rename module if multiple modules are expected or use equal casing if one module is expected.
我在我的入口文件顶部加载所有内容,如下所示:
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import ReduxPromise from 'redux-promise';
import App from './components/app'
import reducers from './reducers'
require('../materialize/css/materialize.css');
require('../materialize/js/materialize.js');
require("../style/main.scss");
JQuery 从 NPM 模块加载如下:
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
现在一切仍然正常,它加载了所有字体、js 文件,并且在应用程序中一切正常/看起来正确,但是有一个警告是有原因的,所以我真的想让它消失!
如果您需要更多信息,请告诉我。
你可以在这里查看完整的源代码https://github.com/gazzer82/freeCodeCamp_Recipes
谢谢
【问题讨论】:
标签: jquery node.js reactjs webpack materialize