Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

[WIP] Remove custom "npm link" behaviour #238

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ All reusable Components (for example avatar) should be done inside the [Nitro-St

More information can be found here: https://github.com/Human-Connection/Nitro-Styleguide


If you need to change something in the styleguide and want to see the effects on the frontend immediately, then we have you covered.
You need to clone the styleguide to the parent directory `../Nitro-Styleguide` and run `yarn && yarn run dev`. After that you run `yarn run dev:styleguide` instead of `yarn run dev` and you will see your changes reflected inside the fronten!
Use [`yarn link`](https://yarnpkg.com/lang/en/docs/cli/link/) to modify the styleguide repository locally:
```sh
# in Nitro-Styleguide
$ yarn link
$ cd ../Nitro-Web
$ yarn link "@human-connection/styleguide"
```

## Internationalization (i18n)

Expand Down
25 changes: 3 additions & 22 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ const pkg = require('./package')
const envWhitelist = ['NODE_ENV', 'MAINTENANCE', 'MAPBOX_TOKEN']
const dev = process.env.NODE_ENV !== 'production'

const styleguidePath = '../Nitro-Styleguide'
const styleguideStyles = process.env.STYLEGUIDE_DEV
? [
`${styleguidePath}/src/system/styles/main.scss`,
`${styleguidePath}/src/system/styles/shared.scss`
]
: '@human-connection/styleguide/dist/shared.scss'

module.exports = {
mode: 'universal',

Expand Down Expand Up @@ -71,7 +63,7 @@ module.exports = {
** Global processed styles
*/
styleResources: {
scss: styleguideStyles
scss: '@human-connection/styleguide/dist/shared.scss'
},

/*
Expand Down Expand Up @@ -178,6 +170,8 @@ module.exports = {
** You can extend webpack config here
*/
extend(config, ctx) {
if (ctx.isDev) config.resolve.symlinks = false

// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
Expand All @@ -187,19 +181,6 @@ module.exports = {
exclude: /(node_modules)/
})
}
if (process.env.STYLEGUIDE_DEV) {
const path = require('path')
config.resolve.alias['@@'] = path.resolve(
__dirname,
`${styleguidePath}/src/system`
)
config.module.rules.push({
resourceQuery: /blockType=docs/,
loader: require.resolve(
`${styleguidePath}/src/loader/docs-trim-loader.js`
)
})
}

const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))
svgRule.test = /\.(png|jpe?g|gif|webp)$/
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
"dev:styleguide": "cross-env STYLEGUIDE_DEV=true yarn dev",
"build": "nuxt build",
"start": "cross-env node server/index.js",
"generate": "nuxt generate",
Expand Down
4 changes: 0 additions & 4 deletions plugins/styleguide-dev.js

This file was deleted.