私はこのエラーが発生してコンパイル中に、反応とwebpackを使用する方法を学ぼうとしています。 ./App.jsモジュール解析でエラー - Webpack
でERROR
Module parse failed: D:\Reactjs\App.js Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import React from 'react';
|
| class App extends React.Component {
マイwebpack.config
module.exports ={
entry:"./App.js",
output: {
path:__dirname,
filename:'app.js'
},
module:{
loader:[{
test: /\.es6\.js$/, loader: "babel-loader",
exclude: /node_modules/,
query: {
optional: ['runtime'],
presets:['stage-0', 'es2015', 'react']
}
}
],
resolve: {
extensions: ['', '.js', '.jsx']
}
}
};
'プリセット'設定で順序を変更しようとしましたか? '['es2015'、 'stage-0'、 'react']'のように? –
は依然として同じ結果です。 –
'include:/ /'を含めてソースフォルダを関連付けます。それが動作するかどうか私に教えてください。 –
phkavitha