@vtex/styleguide
Advanced tools
Comparing version 2.0.0-rc.15 to 2.0.0-rc.17
@@ -49,3 +49,5 @@ 'use strict'; | ||
this.mounted = true; | ||
import('./' + this.toTitleCase(this.props.type)).then(function (module) { | ||
Promise.resolve().then(function () { | ||
return require('./' + _this2.toTitleCase(_this2.props.type)); | ||
}).then(function (module) { | ||
return _this2.mounted && _this2.setState({ module: module.default }); | ||
@@ -52,0 +54,0 @@ }); |
{ | ||
"name": "@vtex/styleguide", | ||
"version": "2.0.0-rc.15", | ||
"version": "2.0.0-rc.17", | ||
"scripts": { | ||
@@ -11,3 +11,3 @@ "test": "react-scripts test --env=jsdom", | ||
"styleguide:build": "styleguidist build", | ||
"compile": "npm run cleanlib && NODE_ENV=production babel --plugins transform-es2015-modules-commonjs ./src/components --out-dir ./lib --ignore '__tests__,*.spec.js' && npm run copycss", | ||
"compile": "npm run cleanlib && NODE_ENV=production babel ./src/components --out-dir ./lib --ignore '__tests__,*.spec.js' && npm run copycss", | ||
"copycss": "copyfiles -u 2 src/**/*.css lib", | ||
@@ -24,2 +24,3 @@ "cleanlib": "sudo rm -rf lib", | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-dynamic-import-node": "^1.2.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", | ||
@@ -26,0 +27,0 @@ "copyfiles": "^1.2.0", |
@@ -20,2 +20,3 @@ ### Styleguide | ||
Run this in this repo: | ||
```sh | ||
@@ -26,6 +27,9 @@ yarn develop | ||
In your project run: | ||
``` | ||
npm link @vtex/styleguide | ||
``` | ||
Import (case a `<Button>` component in lib): | ||
```js | ||
@@ -39,3 +43,3 @@ import Button from '@vtex/styleguide/lib/Button' | ||
releasy pre | ||
npm publish | ||
npm publish | ||
``` | ||
@@ -50,2 +54,3 @@ | ||
#### Known issues | ||
Your project has to run with webpack >= 2. Here's a [guide](https://webpack.js.org/guides/migrating/) for upgrading Webpack to v2. | ||
* Your project has to run with webpack >= 2. Here's a [guide](https://webpack.js.org/guides/migrating/) for upgrading Webpack to v2. |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
50120
990
53
13
2