Electron-react-boilerplate: The way Antd is introduced

Created on 3 Jul 2018  路  3Comments  路  Source: electron-react-boilerplate/electron-react-boilerplate

As an official on-demand introduction, the style does not apply. You can enter the style globally.
em:
In the app.global.css file

  @ import "antd/dist/antd.css";

If so, other ways are welcome

Most helpful comment

@helpceo I solved by modifying webpack.config.render.dev/prod.js

{
  test: /^((?!\.global).)*\.css$/,
  exclude: /node_modules/,
  use: [
    {
      loader: 'style-loader'
    },
    {
      loader: 'css-loader',
      options: {
        modules: true,
        sourceMap: true,
        importLoaders: 1,
        localIdentName: '[name]__[local]__[hash:base64:5]'
      }
    }
  ]
},
{
  test: /\.css$/,
  include: /node_modules/,
  use: [
    {
      loader: 'style-loader'
    },
    {
      loader: 'css-loader'
    }
  ]
}

All 3 comments

You can take a look at this. https://github.com/amilajack/erb-ant-design-example. Let me know if this works for you. If it doesn't i can reopen

@helpceo I solved by modifying webpack.config.render.dev/prod.js

{
  test: /^((?!\.global).)*\.css$/,
  exclude: /node_modules/,
  use: [
    {
      loader: 'style-loader'
    },
    {
      loader: 'css-loader',
      options: {
        modules: true,
        sourceMap: true,
        importLoaders: 1,
        localIdentName: '[name]__[local]__[hash:base64:5]'
      }
    }
  ]
},
{
  test: /\.css$/,
  include: /node_modules/,
  use: [
    {
      loader: 'style-loader'
    },
    {
      loader: 'css-loader'
    }
  ]
}

<link rel="stylesheet" href="../node_modules/antd/dist/antd.css"> app.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MonkeyInWind picture MonkeyInWind  路  3Comments

kennetpostigo picture kennetpostigo  路  3Comments

fandy picture fandy  路  3Comments

amilich picture amilich  路  3Comments

anubra266 picture anubra266  路  3Comments