-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(webpack): config for assets (#4185)
* fix: update config for app and lib to manage static assets (img, svg, fonts) * fix: remove copy of icons bundle inside app root folder
- Loading branch information
1 parent
c47d272
commit 2a8de8a
Showing
11 changed files
with
121 additions
and
86 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,40 @@ | ||
--- | ||
'@talend/scripts-config-react-webpack': patch | ||
--- | ||
|
||
* fix: do not generate both hashed and non hashed assets for fonts, images and svgs. | ||
* fix: do not copy icons into app root folder | ||
* chore: put assets config in common so app and umd configuration are aligned. | ||
|
||
Note: path has been changed this way: | ||
|
||
```diff | ||
# case of woff in lib | ||
- mylib/dist/[hash].woff | ||
- mylib/dist/fonts/[name].woff | ||
+ mylib/dist/assets/fonts/[name].woff | ||
|
||
# case if woff in app | ||
- myapp/dist/[hash].woff | ||
- myapp/dist/fonts/[name].woff | ||
+ myapp/dist/assets/fonts/[name]-[hash].woff | ||
|
||
# case of img in lib | ||
- not supported | ||
+ mylib/dist/assets/img/[name].woff | ||
|
||
# case of img in app | ||
- myapp/dist/[hash].png | ||
- myapp/dist/assets/img/[name].png | ||
+ myapp/dist/assets/img/[name]-[hash].png | ||
|
||
# case of svg in app | ||
- myapp/dist/[hash].svg | ||
- myapp/dist/assets/svg/[name].svg | ||
+ myapp/dist/assets/svg/[name]-[hash].svg | ||
|
||
# case of svg in lib | ||
- mylib/dist/[hash].svg | ||
- mylib/dist/assets/svg/[name].svg | ||
+ mylib/dist/assets/svg/[name]-[hash].svg | ||
``` |
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,5 @@ | ||
--- | ||
'@talend/design-system': patch | ||
--- | ||
|
||
fix: trigger a new release to get ride of hashed assets in the package. |
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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
{ | ||
"preset": "@talend/scripts-preset-react-lib", | ||
"copy": [{ "from": "src/images", "to": "images" }], | ||
"webpack": { | ||
"config": { | ||
"development": "./webpack.config.js", | ||
"production": "./webpack.config.js" | ||
} | ||
} | ||
"webpack": {} | ||
} |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
import React from 'react'; | ||
import Layout from '@talend/react-components/lib/Layout'; | ||
import SidePanel from '@talend/react-containers/lib/SidePanel'; | ||
import HeaderBar from '@talend/react-containers/lib/HeaderBar'; | ||
// eslint-disable-next-line @talend/import-depth | ||
import logo from '@talend/icons/src/svg/products/logo.svg'; | ||
|
||
export function Icons() { | ||
return ( | ||
<Layout mode="TwoColumns" one={<SidePanel />} header={<HeaderBar />}> | ||
<article> | ||
<h1>Use SVG Icons in our apps</h1> | ||
<p> | ||
I can import svg in my app code using the following snippet. You will have the url as | ||
string | ||
</p> | ||
<pre>import logo from '@talend/icons/src/svg/products/logo.svg';</pre> | ||
<p>Current url generated is {logo}</p> | ||
Let's use an image to display it: | ||
<img src={logo} alt="logo" style={{ width: 400 }} /> | ||
</article> | ||
</Layout> | ||
); | ||
} |
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
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