Skip to content

Commit

Permalink
calypso-build: remove dependency on calypso-color-schemes, let projec…
Browse files Browse the repository at this point in the history
…ts define that explicitly
  • Loading branch information
jsnajdr committed Oct 10, 2019
1 parent cea9c70 commit 8e62cfa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/calypso-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"extends @wordpress/browserslist-config"
],
"dependencies": {
"@automattic/calypso-color-schemes": "file:../calypso-color-schemes",
"@babel/core": "7.6.2",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/calypso-build/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = ( { options: { preserveCssCustomProperties = true } } ) => ( {
module.exports = ( {
options: { preserveCssCustomProperties = true, importCssCustomPropertiesFrom },
} ) => ( {
plugins: {
'postcss-custom-properties': {
importFrom: [ require.resolve( '@automattic/calypso-color-schemes' ) ],
importFrom: importCssCustomPropertiesFrom,
preserve: preserveCssCustomProperties,
},
autoprefixer: {},
Expand Down
5 changes: 1 addition & 4 deletions packages/calypso-build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ function getWebpackConfig(
presets,
workerCount,
} ),
SassConfig.loader( {
preserveCssCustomProperties: false,
prelude: '@import "~@automattic/calypso-color-schemes/src/shared/colors";',
} ),
SassConfig.loader(),
FileConfig.loader(),
],
},
Expand Down
8 changes: 7 additions & 1 deletion packages/calypso-build/webpack/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ const path = require( 'path' );
*
* @return {Object} webpack loader object
*/
module.exports.loader = ( { preserveCssCustomProperties, includePaths, prelude } ) => ( {
module.exports.loader = ( {
preserveCssCustomProperties,
importCssCustomPropertiesFrom,
includePaths,
prelude,
} = {} ) => ( {
test: /\.(sc|sa|c)ss$/,
use: [
MiniCssExtractPluginWithRTL.loader,
Expand All @@ -32,6 +37,7 @@ module.exports.loader = ( { preserveCssCustomProperties, includePaths, prelude }
config: {
ctx: {
preserveCssCustomProperties,
importCssCustomPropertiesFrom,
},
path: path.join( __dirname, '..' ),
},
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ const webpackConfig = {
include: shouldTranspileDependency,
} ),
SassConfig.loader( {
importCssCustomPropertiesFrom: [ require.resolve( '@automattic/calypso-color-schemes' ) ],
preserveCssCustomProperties: true,
includePaths: [ path.join( __dirname, 'client' ) ],
prelude: `@import '${ path.join(
Expand Down

0 comments on commit 8e62cfa

Please sign in to comment.