0.78.0 • Published 6 years ago

@bedunkevich/osome-ui-kit v0.78.0

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
6 years ago

osome-ui

yarn storybook

build & watch

yarn build yarn watch

local development

in the osome-ui directory yarn link in the project directory yarn link osome-ui-kit

Projects with webpack

  1. Add the following to webpack.config.js
resolve: {
      alias: {
        'styled-components': path.resolve(paths.appSrc, "../node_modules", "styled-components"),
      },

Projects based on react-create-app

yarn add -D react-app-rewired react-app-rewire-styled-components

package.json

"scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test"
  },

config-overrides.js

const path = require('path');
const rewireStyledComponents = require('react-app-rewire-styled-components');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');

module.exports = function override(config, env) {
  const pathTo = path.resolve(
    __dirname,
    '../../node_modules',
    'styled-components',
  );
  config.resolve.alias['styled-components'] = pathTo;

  config.resolve.plugins = config.resolve.plugins.filter(
    plugin => !(plugin instanceof ModuleScopePlugin),
  );

  config = rewireStyledComponents(config, env);
  return config;
};