File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1072,6 +1072,24 @@ class Encore {
10721072 return webpackConfig . isProduction ( ) ;
10731073 }
10741074
1075+ /**
1076+ * Is this currently a "dev" build?
1077+ *
1078+ * @returns {boolean }
1079+ */
1080+ isDev ( ) {
1081+ return webpackConfig . isDev ( ) ;
1082+ }
1083+
1084+ /**
1085+ * Is this currently a "dev-server" build?
1086+ *
1087+ * @returns {boolean }
1088+ */
1089+ isDevServer ( ) {
1090+ return webpackConfig . isDevServer ( ) ;
1091+ }
1092+
10751093 /**
10761094 * Use this at the bottom of your webpack.config.js file:
10771095 *
Original file line number Diff line number Diff line change @@ -688,6 +688,14 @@ class WebpackConfig {
688688 isProduction ( ) {
689689 return this . runtimeConfig . environment === 'production' ;
690690 }
691+
692+ isDev ( ) {
693+ return this . runtimeConfig . environment === 'dev' ;
694+ }
695+
696+ isDevServer ( ) {
697+ return this . isDev ( ) && this . runtimeConfig . useDevServer ;
698+ }
691699}
692700
693701module . exports = WebpackConfig ;
You can’t perform that action at this time.
0 commit comments