Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR was merged into the master branch. Discussion ---------- Add new methods `isDev()` and `isDevServer()` Hi, This PR adds two new methods `isDev()` and `isDevServer()` aside the already existing `isProduction()` method. On a project at work, we should configure webpack-encore only when we are running the dev-server. There is the property `runtimeConfig.useDevServer` but we don't have access to `runtimeConfig` in our `webpack.config.js`. I know we can do this: ```js const config = Encore.getWebpackConfig(); if (config.devServer) { // .... } ``` but it means that we can't use webpack-encore methods: ```js if (Encore.isDevServer()) { Encore .setPublicPath('http://app.vm:8080/build/') .setManifestKeyPrefix('build/') } ``` Also I tried to add some tests but I didn't find tests for `isProduction()` :( Thanks! Commits ------- c702533 Add new methods `isDev()` and `isDevServer()`
- Loading branch information