我安裝一個反應startUpapp和添加的WebPack但它說Can't resolve './src/index.js'
錄入模塊未找到:錯誤:無法解析」 ./src/index.js'
webpack.config.js Files Look:
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: path.join(__dirname, "public"),
devtool: debug ? "inline-sourcemap" : false,
entry: "./src/index.js",
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2016', 'stage-0'],
plugins: ['react-html-attrs', 'transform-decorators-legacy', 'transform-class-properties'],
}
}
]
},
output: {
path: __dirname + "/public/",
filename: "build.js"
},
plugins: debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
};
感謝@kermit錯誤在./src/index.js中 模塊構建失敗:錯誤:無法找到與目錄「C:\\ Users \\ ashik \」相關的預設「es2016」 \ Desktop「' 但我得到新的錯誤 –
謝謝我解決它通過添加'.babelrc'文件 –