diff --git a/Dockerfile b/Dockerfile index 5201c1847..8ebbb0393 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,7 @@ RUN yarn install --production=false --frozen-lockfile --non-interactive COPY styleguide/ ./styleguide RUN cd styleguide && yarn install --production=false --frozen-lockfile --non-interactive \ && cd .. \ - && yarn run styleguide:build \ - && rm -Rf styleguide/node_modules + && yarn run styleguide:build COPY . . RUN ["yarn", "run", "build"] diff --git a/assets/styles/imports/_tooltip.scss b/assets/styles/imports/_tooltip.scss index 04060b86c..738d6a158 100644 --- a/assets/styles/imports/_tooltip.scss +++ b/assets/styles/imports/_tooltip.scss @@ -1,5 +1,3 @@ -@import 'vue-cion-design-system/src/system/tokens/generated/tokens.scss'; - .tooltip { display: block !important; z-index: 10000; diff --git a/assets/styles/main.scss b/assets/styles/main.scss index a631016f3..7b8c5c2e4 100644 --- a/assets/styles/main.scss +++ b/assets/styles/main.scss @@ -1,4 +1,3 @@ -@import 'vue-cion-design-system/src/system/tokens/generated/tokens.scss'; @import './imports/_tooltip.scss'; @import './imports/_toast.scss'; diff --git a/nuxt.config.js b/nuxt.config.js index bc5f3d184..ea5b8b52f 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,6 +1,7 @@ const pkg = require('./package') const envWhitelist = ['NODE_ENV', 'MAINTENANCE'] const dev = process.env.NODE_ENV !== 'production' +const path = require('path') module.exports = { mode: 'universal', @@ -54,7 +55,6 @@ module.exports = { ** Global CSS */ css: ['~assets/styles/main.scss'], - /* ** Plugins to load before mounting the App */ @@ -103,7 +103,11 @@ module.exports = { ['@nuxtjs/dotenv', { only: envWhitelist }], ['nuxt-env', { keys: envWhitelist }], '@nuxtjs/apollo', - '@nuxtjs/axios' + '@nuxtjs/axios', + [ + 'nuxt-sass-resources-loader', + path.resolve(__dirname, './styleguide/src/system/styles/shared.scss') + ] ], /* @@ -185,6 +189,32 @@ module.exports = { exclude: /(node_modules)/ }) } + config.resolve.alias['@@'] = path.resolve( + __dirname, + './styleguide/src/system' + ) + config.module.rules.push({ + resourceQuery: /blockType=docs/, + loader: require.resolve('./styleguide/src/loader/docs-trim-loader.js') + }) + const svgRule = config.module.rules.find(rule => rule.test.test('.svg')) + svgRule.test = /\.(png|jpe?g|gif|webp)$/ + config.module.rules.push({ + test: /\.svg$/, + loader: 'vue-svg-loader', + options: { + svgo: { + plugins: [ + { + removeViewBox: false + }, + { + removeDimensions: true + } + ] + } + } + }) } } } diff --git a/package.json b/package.json index 9412de52f..e64eca33e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "generate": "nuxt generate", "lint": "eslint --ext .js,.vue .", "styleguide": "cd ./styleguide && yarn dev", - "styleguide:build": "cd ./styleguide && yarn build:lib && cd ../ && yarn upgrade vue-cion-design-system", + "styleguide:build": "cd ./styleguide && yarn build:lib && cd ../", "test": "jest", "precommit": "yarn lint" }, @@ -45,7 +45,6 @@ "nuxt": "^2.0.0", "nuxt-env": "^0.0.4", "v-tooltip": "^2.0.0-rc.33", - "vue-cion-design-system": "file:./styleguide", "vue-count-to": "^1.0.13", "vue-izitoast": "git://github.com/arthurvasconcelos/vue-izitoast.git" }, @@ -63,8 +62,10 @@ "jest": "^23.6.0", "node-sass": "^4.9.3", "nodemon": "^1.11.0", + "nuxt-sass-resources-loader": "^2.0.5", "prettier": "1.14.3", "sass-loader": "^7.1.0", - "vue-jest": "^3.0.0" + "vue-jest": "^3.0.0", + "vue-svg-loader": "^0.11.0" } } diff --git a/pages/post/_slug/index.vue b/pages/post/_slug/index.vue index 9bd14f2a7..fbb185c9e 100644 --- a/pages/post/_slug/index.vue +++ b/pages/post/_slug/index.vue @@ -179,8 +179,6 @@ export default {