Reactjs 由于运行时环境没有';似乎没有进行配置

Reactjs 由于运行时环境没有';似乎没有进行配置,reactjs,webpack,phpstorm,webstorm,Reactjs,Webpack,Phpstorm,Webstorm,我正在设置webpack.config.js,但是我错过了setOutputPath()函数发出的警告PhpStorm消息 我有PhpStorm的2018.3.2版,我在Linux Debian中工作 let Encore=require(“@symfony/webpack Encore”); 再来一个 .setOutputPath('public/build/') .setPublicPath(“/build”) .addEntry('app','。/assets/js/app.js') .s

我正在设置webpack.config.js,但是我错过了
setOutputPath()
函数发出的警告PhpStorm消息

我有PhpStorm的2018.3.2版,我在Linux Debian中工作

let Encore=require(“@symfony/webpack Encore”);
再来一个
.setOutputPath('public/build/')
.setPublicPath(“/build”)
.addEntry('app','。/assets/js/app.js')
.splitEntryChunks()
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()之前
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableReactPreset()
.configureBabel(功能(babelConfig){
babelConfig.presets.push(“@babel/preset flow”);
babelConfig.plugins.push(“@babel/plugin提案类属性”);
babelConfig.plugins.push('styled-jsx/babel');
});
module.exports=Encore.getWebpackConfig();

PHPStorm当前不支持网页包加密

有关可能的解决方法,请参阅中的和其他注释

它失败,因为只配置了Encore运行时环境 当您运行它时(例如,当执行
纱线安可开发
时)。修理 此问题调用Encore.isRuntimeEnvironmentConfigured()和
Encore.configureRuntimeEnvironment()
方法:

// webpack.config.js
const Encore = require('@symfony/webpack-encore')

if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

// ... the rest of the Encore configuration