Comments (3)
我看下package.json里面的信息
from ztree-for-react.
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');
var proxy = require('http-proxy-middleware');
module.exports = {
context: path.join(__dirname),
devtool: debug ? "inline-sourcemap" : null,
entry: "./src/js/root.js",
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015']
}
},
//下面是使用 ant-design 的配置文件
{ test: /\.css$/, loader: 'style-loader!css-loader' }
/*//下面是添加的 css 的 loader,也即是 css 模块化的配置方法,大家可以拷贝过去直接使用
{
test: /\.css$/,
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
},*/
]
},
output: {
path: __dirname,
filename: "./src/bundle.js"
},
devServer: {
historyApiFallback : true,//解决BrowserRouter不跳转问题
proxy : {
'/api/' : {
target : 'http://localhost:8090',//这里将符合 /api/... 的请求转发至此,实际是先转到 localhost:8080/api/ 之后 webpack-dev-server转发至此
changeOrigin : true,
secure : true
}
}
},
plugins: debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
new webpack.ProvidePlugin({ //加载jq
$: 'jquery',
jQuery: 'jquery'
}),
],
};
{
"name": "party",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start" : "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"antd": "^3.1.6",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-import": "^1.6.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babelify": "^8.0.0",
"css-loader": "^0.28.9",
"echarts": "^4.0.4",
"echarts-for-react": "^2.0.8",
"fetch": "^1.1.0",
"jquery": "^3.3.1",
"mockjs": "^1.0.1-beta3",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-tinymce": "^0.7.0",
"style-loader": "^0.20.1",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1"
},
"devDependencies": {
"ztree-for-react": "^0.1.5"
}
}
谢谢,上面是webpack.config下面是package.json
from ztree-for-react.
应该是jQuery版本引起的问题,把jQuery版本换成2.2.1试试
from ztree-for-react.
Related Issues (9)
- preact:ReferenceError: jQuery is not defined HOT 5
- how to congfig in config-overrrides.js to avoid jQuery is not defined error?
- about ztree-for-react questions
- 项目安装了expose-loader和jquery并且在webpack.config.js中做了配置还是报错:jQuery is not defined HOT 4
- ztree-for-react组件移除时报错 Uncaught TypeError: this.ztreeObj.destory is not a function HOT 2
- Element type is invalid HOT 1
- rename the node HOT 1
- Uncaught TypeError: Cannot read property 'init' of undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ztree-for-react.