@@ -15,6 +15,7 @@ const {
1515} = require ( '@dnb/eufemia/src/plugins/postcss-isolated-style-scope/config' )
1616
1717const PREBUILD_EXISTS = shouldUsePrebuild ( )
18+ const isMini = process . env . BUILD_MINI === '1'
1819
1920// Used for heading
2021const {
@@ -120,17 +121,23 @@ exports.createResolvers = ({ createResolvers }) => {
120121}
121122
122123exports . createPages = async ( params ) => {
124+ if ( isMini ) {
125+ return
126+ }
123127 await createRedirects ( params )
124128}
125129
126130exports . onPostBuild = async ( params ) => {
131+ if ( isMini ) {
132+ return
133+ }
127134 await createRedirects ( params )
128135
129136 if ( deletedPages . length ) {
130137 params . reporter . warn (
131138 `❗️ These pages were deleted:\n${ deletedPages
132139 . map ( ( page ) => `├ ${ page } ` )
133- . join ( '\n' ) } \n\n`,
140+ . join ( '\n' ) } \n\n`
134141 )
135142 }
136143
@@ -277,20 +284,20 @@ exports.onCreateWebpackConfig = ({
277284 // Algolia info
278285 plugins . define ( {
279286 'process.env.ALGOLIA_INDEX_NAME' : JSON . stringify (
280- process . env . ALGOLIA_INDEX_NAME || 'dev_eufemia_docs' ,
287+ process . env . ALGOLIA_INDEX_NAME || 'dev_eufemia_docs'
281288 ) ,
282289 'process.env.ALGOLIA_APP_ID' : JSON . stringify (
283- process . env . ALGOLIA_APP_ID || 'SLD6KEYMQ9' ,
290+ process . env . ALGOLIA_APP_ID || 'SLD6KEYMQ9'
284291 ) ,
285292 'process.env.ALGOLIA_SEARCH_KEY' : JSON . stringify (
286293 process . env . ALGOLIA_SEARCH_KEY ||
287- '6cf238b7456ffd9f7a400d8de37318a3' ,
294+ '6cf238b7456ffd9f7a400d8de37318a3'
288295 ) ,
289296 'process.env.ENABLE_BUILD_STYLE_SCOPE' : JSON . stringify (
290- enableBuildStyleScope ( ) ,
297+ enableBuildStyleScope ( )
291298 ) ,
292299 'process.env.ENABLE_PORTAL_STYLE_SCOPE' : JSON . stringify (
293- enablePortalStyleScope ( ) ,
300+ enablePortalStyleScope ( )
294301 ) ,
295302 } ) ,
296303 ] ,
@@ -299,25 +306,25 @@ exports.onCreateWebpackConfig = ({
299306 if ( PREBUILD_EXISTS && stage === 'build-javascript' ) {
300307 if ( PREBUILD_EXISTS && ! isCI ) {
301308 reporter . warn (
302- '😱 There is a "dnb-eufemia/build" in your local repo. It is used during your local Portal build! \nKeep in mind, the code from "dnb-eufemia/build" may be outdated. \n\n👉 You can remove the build with: "yarn build:clean"\n\n' ,
309+ '😱 There is a "dnb-eufemia/build" in your local repo. It is used during your local Portal build! \nKeep in mind, the code from "dnb-eufemia/build" may be outdated. \n\n👉 You can remove the build with: "yarn build:clean"\n\n'
303310 )
304311 }
305312
306313 config . plugins . push (
307314 plugins . normalModuleReplacement ( / @ d n b \/ e u f e m i a \/ s r c / , ( resource ) => {
308315 resource . request = resource . request . replace (
309316 / @ d n b \/ e u f e m i a \/ s r c ( .* ) / ,
310- '@dnb/eufemia/build$1' ,
317+ '@dnb/eufemia/build$1'
311318 )
312- } ) ,
319+ } )
313320 )
314321 }
315322
316323 // Suppress mini-css-extract-plugin "Conflicting order" warnings
317324 if ( stage === 'build-javascript' || stage === 'develop' ) {
318325 const webpackConfig = getConfig ( )
319326 const miniCssExtractPlugin = webpackConfig . plugins . find (
320- ( plugin ) => plugin . constructor . name === 'MiniCssExtractPlugin' ,
327+ ( plugin ) => plugin . constructor . name === 'MiniCssExtractPlugin'
321328 )
322329 if ( miniCssExtractPlugin ) {
323330 miniCssExtractPlugin . options . ignoreOrder = true
@@ -340,7 +347,7 @@ exports.onCreateDevServer = (params) => {
340347 params . reporter . info (
341348 `🚀 You can only visit these pages:\n\n${ createdPages
342349 . map ( ( page ) => `├ http://localhost:8000${ page } ` )
343- . join ( '\n' ) } \n`,
350+ . join ( '\n' ) } \n`
344351 )
345352 }
346353}
0 commit comments