| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + module.exports = { | ||
| 2 | + buildDir: __dirname + '/public', | ||
| 3 | + wwwDir: __dirname + '/public/', | ||
| 4 | + publicPath: '/public/styleguide/', | ||
| 5 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,10 +13,11 @@ | |||
| 13 | 13 | ], | |
| 14 | 14 | "main": "patternlab-config.json", | |
| 15 | 15 | "scripts": { | |
| 16 | - "build": "patternlab build --config ./patternlab-config.json", | ||
| 16 | + "build:uikit": "npm run build --prefix node_modules/@pattern-lab/uikit-workshop -- --patternlabrc $INIT_CWD/.patternlabrc.js", | ||
| 17 | + "build": "npm run build:uikit && patternlab build --config ./patternlab-config.json", | ||
| 17 | 18 | "help": "patternlab --help", | |
| 18 | 19 | "install": "patternlab install --config ./patternlab-config.json", | |
| 19 | - "serve": "patternlab serve --config ./patternlab-config.json", | ||
| 20 | + "serve": "npm run build:uikit && patternlab serve --config ./patternlab-config.json", | ||
| 20 | 21 | "start": "npm run serve", | |
| 21 | 22 | "version": "patternlab --version" | |
| 22 | 23 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -344,9 +344,13 @@ class IFrame extends BaseComponent { | |||
| 344 | 344 | ||
| 345 | 345 | if (!patternParam) { | |
| 346 | 346 | if (window.patternData) { | |
| 347 | - patternParam = window.patternData.patternPartial; | ||
| 347 | + if (window.patternData.patternPartial) { | ||
| 348 | + patternParam = window.patternData.patternPartial; | ||
| 349 | + } else { | ||
| 350 | + patternParam = 'all'; | ||
| 351 | + } | ||
| 348 | 352 | } else { | |
| 349 | - patternParam = 'components-overview'; | ||
| 353 | + patternParam = 'all'; | ||
| 350 | 354 | } | |
| 351 | 355 | } | |
| 352 | 356 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,10 @@ | |||
| 2 | 2 | {{{ patternData }}} | |
| 3 | 3 | </script> | |
| 4 | 4 | ||
| 5 | + <script> | ||
| 6 | + window.patternData = {{{ patternData }}}; | ||
| 7 | + </script> | ||
| 8 | + | ||
| 5 | 9 | <script> | |
| 6 | 10 | /*! | |
| 7 | 11 | * scriptLoader - v0.1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,6 +11,7 @@ const selectorImporter = require('node-sass-selector-importer'); | |||
| 11 | 11 | const PrerenderSPAPlugin = require('prerender-spa-plugin'); | |
| 12 | 12 | const CopyPlugin = require('copy-webpack-plugin'); | |
| 13 | 13 | const path = require('path'); | |
| 14 | + const argv = require('yargs').argv; | ||
| 14 | 15 | ||
| 15 | 16 | const cosmiconfig = require('cosmiconfig'); | |
| 16 | 17 | const explorer = cosmiconfig('patternlab'); | |
@@ -27,8 +28,14 @@ const defaultConfig = { | |||
| 27 | 28 | module.exports = async function() { | |
| 28 | 29 | return new Promise(async (resolve, reject) => { | |
| 29 | 30 | let customConfig = defaultConfig; | |
| 31 | + let configToSearchFor; | ||
| 32 | + | ||
| 33 | + if (argv.patternlabrc) { | ||
| 34 | + configToSearchFor = await explorer.loadSync(argv.patternlabrc); | ||
| 35 | + } else { | ||
| 36 | + configToSearchFor = await explorer.searchSync(); | ||
| 37 | + } | ||
| 30 | 38 | ||
| 31 | - const configToSearchFor = await explorer.searchSync(); | ||
| 32 | 39 | if (configToSearchFor) { | |
| 33 | 40 | if (configToSearchFor.config) { | |
| 34 | 41 | customConfig = configToSearchFor.config; | |
@@ -100,7 +107,7 @@ module.exports = async function() { | |||
| 100 | 107 | }, | |
| 101 | 108 | output: { | |
| 102 | 109 | path: path.resolve(process.cwd(), `${config.buildDir}/styleguide`), | |
| 103 | - publicPath: '/pattern-lab/styleguide/', | ||
| 110 | + publicPath: `${config.publicPath}`, | ||
| 104 | 111 | filename: '[name].js', | |
| 105 | 112 | chunkFilename: `js/[name]-chunk-[chunkhash].js`, | |
| 106 | 113 | }, | |
@@ -311,6 +318,9 @@ module.exports = async function() { | |||
| 311 | 318 | ||
| 312 | 319 | // @todo: troubleshoot why forceInclude works w/ Penthouse directly but not w/ Critical | |
| 313 | 320 | forceInclude: [ | |
| 321 | + 'pl-logo', | ||
| 322 | + '.pl-c-logo', | ||
| 323 | + '.pl-c-logo__img', | ||
| 314 | 324 | '.pl-c-body--theme-light', | |
| 315 | 325 | '.pl-c-body--theme-sidebar', | |
| 316 | 326 | '.pl-c-body--theme-sidebar .pl-c-viewport', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments