From fbcd0c8d8eb68eb4694394983a5467285fd94371 Mon Sep 17 00:00:00 2001 From: Aral Roca Gomez Date: Wed, 10 Jun 2020 09:51:45 +0200 Subject: [PATCH] Change behavior of css/scss files inside pages_ (copy them instead of ignore them) (#201) * Change behavior of css/scss files inside pages_ (copy them instead of ignore them) * Update package version --- cli/builder.js | 8 +++----- package.json | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/builder.js b/cli/builder.js index 1500c6c9..174d21d7 100755 --- a/cli/builder.js +++ b/cli/builder.js @@ -128,11 +128,9 @@ function readPageNamespaces() { // Clear index folder case .replace(/\/index$/, '') || '/' - if (pageId.match(/\.s?css$/)) return - const namespaces = await getPageNamespaces({ pages }, pageId) - if (!isNextInternal(page) && logBuild) { + if (!isNextInternal(page) && logBuild && !pageId.match(/\.s?css$/)) { console.log(`🔨 ${pageId}`, namespaces) } @@ -249,8 +247,8 @@ function buildPageInAllLocales(pagePath, namespaces) { prefix = prefix.replace('/..', '') } - // _app.js , _document.js, _error.js, /api/* - if (isNextInternal(pagePath)) { + // _app.js , _document.js, _error.js, /api/*, .css, .scss + if (isNextInternal(pagePath) || pagePath.match(/\.s?css$/)) { if (pagePath.includes('/api/')) { fs.mkdirSync(`${finalPagesDir}/api`, { recursive: true }) copyFolderRecursiveSync( diff --git a/package.json b/package.json index ea825971..179b7360 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-translate", - "version": "0.17.2-canary.1", + "version": "0.17.2-canary.2", "description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).", "license": "MIT", "keywords": [