-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STRWEB-69: Add support for transpilation (#73)
* Add support for transpilation * Cleanup * Cleanup * Continue on transpilation * Cleanup * Cleanup * Cleanup * More work on transpilation * Cleanup * Cleanup * Cleanup * Cleanup * Cleanup * Cleanup * Cleanup * More work on transpilation * Cleanup * Cleanup * Cleanup * Handle already transpiled CSS files * Cleanup * Cleanup * Fix tests * Add woff2 support * Remove empty scripts * skip stripes-ui from transpilation * Add disableDeprecationNotice to postcss * Improve path resolution * Update css entry * use path.sep * Cleanup * Adjust css dist path regex * More cleanup for Windows * Fix tests * Cleanup css based on feedback * Adjust tsconfig * Cleanup * Remove only to run all tests * Adjust dependencies * Add ts and tsx to babel-loader test in transpilation config * Adjust shared styles
- Loading branch information
Showing
19 changed files
with
557 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// The list of the default externals | ||
// https://webpack.js.org/configuration/externals/ | ||
const defaultExternals = [ | ||
'@folio/stripes', | ||
'@folio/stripes-components', | ||
'@folio/stripes-connect', | ||
'@folio/stripes-core', | ||
'@folio/stripes-util', | ||
'@folio/stripes-form', | ||
'@folio/stripes-final-form', | ||
'@folio/stripes-logger', | ||
'@folio/stripes-smart-components', | ||
'final-form', | ||
'final-form-arrays', | ||
'moment', | ||
'moment-timezone', | ||
'react', | ||
'react-dom', | ||
'react-final-form', | ||
'react-final-form-arrays', | ||
'react-final-form-listeners', | ||
'react-intl', | ||
'react-query', | ||
'react-redux', | ||
'react-router', | ||
'redux', | ||
'stripes-config', | ||
]; | ||
|
||
module.exports = { | ||
defaultExternals, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const path = require('path'); | ||
const postCssImport = require('postcss-import'); | ||
const autoprefixer = require('autoprefixer'); | ||
const postCssCustomProperties = require('postcss-custom-properties'); | ||
const postCssCalc = require('postcss-calc'); | ||
const postCssNesting = require('postcss-nesting'); | ||
const postCssCustomMedia = require('postcss-custom-media'); | ||
const postCssMediaMinMax = require('postcss-media-minmax'); | ||
const postCssColorFunction = require('postcss-color-function'); | ||
|
||
const { generateStripesAlias, tryResolve } = require('./webpack/module-paths'); | ||
|
||
const locateCssVariables = () => { | ||
const variables = 'lib/variables.css'; | ||
const localPath = path.join(path.resolve(), variables); | ||
|
||
// check if variables are present locally (in cases when stripes-components is | ||
// being built directly) if not look for them via stripes aliases | ||
return tryResolve(localPath) ? | ||
localPath : | ||
path.join(generateStripesAlias('@folio/stripes-components'), variables); | ||
}; | ||
|
||
module.exports = { | ||
plugins: [ | ||
postCssImport(), | ||
autoprefixer(), | ||
postCssCustomProperties({ | ||
preserve: false, | ||
importFrom: [locateCssVariables()], | ||
disableDeprecationNotice: true | ||
}), | ||
postCssCalc(), | ||
postCssNesting(), | ||
postCssCustomMedia(), | ||
postCssMediaMinMax(), | ||
postCssColorFunction(), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.