Clean duplicate code in UI project

This commit is contained in:
dannyrb committed 2019-08-06 14:22:44 -04:00
1 parent 60f48fbdc0
commit e47dcf27fc
11 files changed
+57 -217

No files matched your search

+34 -72
View File
@@ -3,48 +3,44 @@
* https://www.docz.site/docs/project-configuration
*/
import { css } from 'docz-plugin-css';
import { css } from "docz-plugin-css";
export default {
dest: 'example/build',
public: '/public',
wrapper: 'src/__docs__/wrapper',
indexHtml: 'src/__docs__/index.html',
dest: "example/build",
public: "/public",
wrapper: "src/__docs__/wrapper",
indexHtml: "src/__docs__/index.html",
// Limited support for importing `.styl` files
codeSandbox: false,
// https://github.com/pedronauck/docz/pull/849/files
// Because we re-export using `index.js` files
notUseSpecifiers: true,
// filterComponents: files =>
// files.filter(filepath =>
// /\/[A-Z]\w*(\/index)?\.(js|jsx|ts|tsx)$/.test(filepath)
// ),
menu: [
'Introduction',
'Getting Started',
{ name: 'Elements', menu: ['Form / Select'] },
"Introduction",
"Getting Started",
{ name: "Elements", menu: ["Form / Select"] },
{
name: 'Components',
name: "Components",
menu: [
'CINE Dialog',
'Layout Button',
'Measurement Table',
'Overlay Trigger',
'Quick Switch',
'Rounded Button Group',
'Select Tree',
'Simple Dialog',
'Study Browser',
'Study List',
'Table List',
'Toolbar Section',
'About Modal',
'User Preferences Modal',
],
"CINE Dialog",
"Layout Button",
"Measurement Table",
"Overlay Trigger",
"Quick Switch",
"Rounded Button Group",
"Select Tree",
"Simple Dialog",
"Study Browser",
"Study List",
"Table List",
"Toolbar Section",
"About Modal",
"User Preferences Modal"
]
},
'Styling & Theming',
'Translating',
'Compatibility',
"Styling & Theming",
"Translating",
"Compatibility"
],
// Rollup Aliases?
// https://github.com/pedronauck/docz/issues/373
@@ -53,9 +49,9 @@ export default {
css(),
// Stylus
css({
preprocessor: 'stylus',
cssmodules: false,
}),
preprocessor: "stylus",
cssmodules: false
})
],
// `docz` uses file-loader to pull in SVGs. This kills our icons before
// They can be picked up by our `babel-plugin-inline-react-svg` dependency
@@ -64,50 +60,16 @@ export default {
// How we delete our rule:
// https://github.com/neutrinojs/webpack-chain/issues/48
onCreateWebpackChain: config => {
config.module.rules.delete('svg');
// config.module
// .rule('svg')
// .test(/\.(svg)(\?.*)?$/)
// .use('file-loader')
// .loader(require.resolve('file-loader'))
// .options({
// name: `static/img/[name].[ext]`,
// })
config.module.rules.delete("svg");
},
modifyBabelRc: babelrc => {
const newBabelRc = {
...babelrc,
plugins: [
...babelrc.plugins,
require.resolve('babel-plugin-inline-react-svg'),
],
require.resolve("babel-plugin-inline-react-svg")
]
};
return newBabelRc;
},
}
};
/*
* Alternative ways to extend/modify underlying webpack config
*
modifyBundlerConfig: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: ["style-loader", "css-loader", "sass-loader"]
})
return config
}
*
*
*
onCreateWebpackChain: config => {
config.module
.rule('css')
.test(/\.css$/)
.use('css-loader')
.loader('css-loader')
.options({ sourceMap: false,
importLoaders: 2 })
}
*/