Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STRWEB-109 allow loading of arbitrary text files #145

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Don't worry about the order of CSS imports across modules. Refs STRWEB-110.
* Remove postcss-plugins: postcss-nesting, postcss-custom-properties, postcss-color-function, postcss-calc. Add CSS variables entry point in webpack config. Refs STRWEB-111.
* Support import of arbitrary text files via `?raw`. Refs STRWEB-109.

## [5.1.0](https://github.com/folio-org/stripes-webpack/tree/v5.1.0) (2024-03-12)
[Full Changelog](https://github.com/folio-org/stripes-webpack/compare/v5.0.0...v5.1.0)
Expand Down
10 changes: 10 additions & 0 deletions webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ const baseConfig = {
resourceQuery: /icon/, // stcom icons use this query on the resource.
use: ['@svgr/webpack']
},
// allow import of arbitrary files as strings by appending `?raw` to the import.
// use it like:
// import someString from "./someTxtFile.txt?raw"
// see https://github.com/webpack/webpack/discussions/16775#discussioncomment-5233250
// see https://webpack.js.org/guides/asset-modules/
// this facilitates importing large files as strings, e.g. XSLT
{
type: 'asset/source',
resourceQuery: /raw/,
},
],
},
};
Expand Down
Loading