mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2025-01-09 05:06:53 -06:00
PR-489489: Adding baseUrl.
This commit is contained in:
parent
58ae2bcc9b
commit
bd09a8d244
@ -4,3 +4,5 @@ LIBRARY_NAME=
|
|||||||
EXTERNAL_CSS=
|
EXTERNAL_CSS=
|
||||||
#External CSS NAME (Default: index.css)
|
#External CSS NAME (Default: index.css)
|
||||||
EXTERNAL_CSS_NAME=
|
EXTERNAL_CSS_NAME=
|
||||||
|
#PREFIX URL (Default: '')
|
||||||
|
PREFIX_URL=
|
@ -1,9 +1,19 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||||
|
const deFaultValues = {
|
||||||
|
PREFIX_URL: ''
|
||||||
|
}
|
||||||
|
const prefixUrl = process.env.PREFIX_URL ? process.env.PREFIX_URL : deFaultValues.PREFIX_URL
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
"stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||||
"addons": ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/preset-scss"],
|
"addons": ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/preset-scss"],
|
||||||
"webpackFinal": async config => {
|
"webpackFinal": async config => {
|
||||||
|
config.entry = config.entry.map(function(entry) {
|
||||||
|
if (entry.includes("webpack-hot-middleware")) {
|
||||||
|
return `${require.resolve('webpack-hot-middleware/client')}?path=${prefixUrl}__webpack_hmr&reload=true`;
|
||||||
|
}
|
||||||
|
return entry;
|
||||||
|
}),
|
||||||
config.resolve.alias = {
|
config.resolve.alias = {
|
||||||
...config.resolve.alias,
|
...config.resolve.alias,
|
||||||
'@components': path.resolve(__dirname, "../src/components/")
|
'@components': path.resolve(__dirname, "../src/components/")
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@aleleba/create-react-component-library",
|
"name": "@aleleba/create-react-component-library",
|
||||||
"version": "1.2.10",
|
"version": "1.2.11",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@aleleba/create-react-component-library",
|
"name": "@aleleba/create-react-component-library",
|
||||||
"version": "1.2.10",
|
"version": "1.2.11",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-react-component-library": "bin/cli.js"
|
"create-react-component-library": "bin/cli.js"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aleleba/create-react-component-library",
|
"name": "@aleleba/create-react-component-library",
|
||||||
"version": "1.2.10",
|
"version": "1.2.11",
|
||||||
"description": "A starter kit for create a React component Library with storybook",
|
"description": "A starter kit for create a React component Library with storybook",
|
||||||
"bin": "./bin/cli.js",
|
"bin": "./bin/cli.js",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user