Ad

Encore.setOutputPath() Cannot Be Called Yet Because The Runtime Environment Doesn't Appear To Be Configured

- 1 answer

I'm setting webpack.config.js but I miss that warning PhpStorm message by the setOutputPath() function

I have the version 2018.3.2 of PhpStorm, and I am working in Linux Debian

let Encore = require('@symfony/webpack-encore');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .addEntry('app', './assets/js/app.js')
    .splitEntryChunks()
    .enableSingleRuntimeChunk()
    .cleanupOutputBeforeBuild()
    .enableBuildNotifications()
    .enableSourceMaps(!Encore.isProduction())
    .enableVersioning(Encore.isProduction())
    .enableReactPreset()
    .configureBabel(function (babelConfig) {
        babelConfig.presets.push('@babel/preset-flow');
        babelConfig.plugins.push("@babel/plugin-proposal-class-properties");
        babelConfig.plugins.push('styled-jsx/babel');
    });

module.exports = Encore.getWebpackConfig();
Ad

Answer

PHPStorm doesn't currently support webpack-encore.

Please see https://github.com/symfony/webpack-encore/issues/236#issuecomment-438620314 and other comments in https://github.com/symfony/webpack-encore/issues/236 for possible workarounds.

Ad
source: stackoverflow.com
Ad