Skip to content

Commit

Permalink
Change behavior of css/scss files inside pages_ (copy them instead of…
Browse files Browse the repository at this point in the history
… ignore them) (#201)

* Change behavior of css/scss files inside pages_ (copy them instead of ignore them)

* Update package version
  • Loading branch information
aralroca authored Jun 10, 2020
1 parent 9671c65 commit fbcd0c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions cli/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit fbcd0c8

Please sign in to comment.