Skip to content

Commit

Permalink
fix(umi-buil-dev): global.scss don't work (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc authored Apr 12, 2018
1 parent f49093d commit a73589a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/umi-build-dev/src/getWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ export default function(service = {}) {
...(webpackRCConfig.extraResolveModules || []),
...(extraResolveModules || []),
],
cssModulesExcludes: [
...(webpackRCConfig.cssModulesExcludes || []),
join(paths.absSrcPath, 'global.css'),
join(paths.absSrcPath, 'global.less'),
],
cssModulesExcludes: [...(webpackRCConfig.cssModulesExcludes || [])],
define: {
// 禁用 antd-mobile 升级提醒
'process.env.DISABLE_ANTD_MOBILE_UPGRADE': true,
Expand Down
13 changes: 13 additions & 0 deletions packages/umi-build-dev/src/plugins/global-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,17 @@ ${cssImports.join('\\r\\n')}
join(paths.absSrcPath, 'global.scss'),
];
});

api.register('modifyAFWebpackOpts', ({ memo }) => {
return {
...memo,
cssModulesExcludes: [
...(memo.cssModulesExcludes || []),
join(paths.absSrcPath, 'global.css'),
join(paths.absSrcPath, 'global.less'),
join(paths.absSrcPath, 'global.scss'),
join(paths.absSrcPath, 'global.sass'),
],
};
});
}

0 comments on commit a73589a

Please sign in to comment.