|
| 1 | +constpath=require('path') |
| 2 | +constMiniCssExtractPlugin=require('mini-css-extract-plugin') |
| 3 | + |
1 | 4 | // import '../src/styles/reset.css'
|
2 | 5 |
|
3 | 6 | module.exports={
|
4 | 7 | core:{
|
5 |
| -builder:'webpack5', |
| 8 | +builder:'webpack4', |
6 | 9 | },
|
7 | 10 | stories:['../stories/Temp.stories.tsx','../stories/Error.stories.tsx'],
|
8 | 11 | addons:['@storybook/addon-actions','@storybook/addon-knobs','@storybook/addon-links'],
|
9 | 12 | babel:async(options)=>({
|
10 | 13 | ...options,
|
11 | 14 | presets:[...options.presets,'@emotion/babel-preset-css-prop','@babel/preset-react'],
|
| 15 | +plugins:[ |
| 16 | +[ |
| 17 | +'import', |
| 18 | +{ |
| 19 | +libraryName:'@alifd/next', |
| 20 | +style:true, |
| 21 | +}, |
| 22 | +], |
| 23 | +], |
12 | 24 | }),
|
| 25 | +webpackFinal:(config)=>{ |
| 26 | +config.module.rules.push({ |
| 27 | +test:/\.scss$/, |
| 28 | +use:['style-loader','css-loader','sass-loader'], |
| 29 | +}) |
| 30 | +config.module.rules.push({ |
| 31 | +test:/\.(ts|tsx)$/, |
| 32 | +loader:require.resolve('babel-loader'), |
| 33 | +}) |
| 34 | + |
| 35 | +config.plugins.push(newMiniCssExtractPlugin({filename:'[name].css'})) |
| 36 | +config.resolve.extensions.push('.ts','.tsx') |
| 37 | + |
| 38 | +config.resolve.modules=['node_modules',path.resolve(__dirname,'../src')] |
| 39 | + |
| 40 | +returnconfig |
| 41 | +}, |
13 | 42 | }
|