diff --git a/build-tests-samples/heft-web-rig-app-tutorial/package.json b/build-tests-samples/heft-web-rig-app-tutorial/package.json index 0d61b9e0eb3..c12979af8d3 100644 --- a/build-tests-samples/heft-web-rig-app-tutorial/package.json +++ b/build-tests-samples/heft-web-rig-app-tutorial/package.json @@ -22,6 +22,7 @@ "@types/heft-jest": "1.0.1", "@types/react-dom": "16.9.14", "@types/react": "16.14.23", + "@types/webpack-env": "1.13.0", "typescript": "~4.5.2" } } diff --git a/build-tests-samples/heft-web-rig-app-tutorial/src/ExampleApp.tsx b/build-tests-samples/heft-web-rig-app-tutorial/src/ExampleApp.tsx index 89e72d2f738..f003efacfaa 100644 --- a/build-tests-samples/heft-web-rig-app-tutorial/src/ExampleApp.tsx +++ b/build-tests-samples/heft-web-rig-app-tutorial/src/ExampleApp.tsx @@ -9,17 +9,19 @@ export class ExampleApp extends React.Component { const appStyle: React.CSSProperties = { backgroundColor: '#ffffff', padding: '20px', + margin: '20px', borderRadius: '5px', width: '400px' }; return ( -
-
-

Hello, world!

- Here is an example control: - -
+
+

Hello, world!

+

Here is an example control:

+ + +

Here is an example image:

+
); } diff --git a/build-tests-samples/heft-web-rig-app-tutorial/src/example-image.png b/build-tests-samples/heft-web-rig-app-tutorial/src/example-image.png new file mode 100644 index 00000000000..94fda081fac Binary files /dev/null and b/build-tests-samples/heft-web-rig-app-tutorial/src/example-image.png differ diff --git a/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json b/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json index fb08dbd90d8..bb41d01a056 100644 --- a/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json +++ b/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./node_modules/@rushstack/heft-web-rig/profiles/app/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest"] + "types": ["heft-jest", "webpack-env"] } } diff --git a/build-tests-samples/heft-web-rig-library-tutorial/package.json b/build-tests-samples/heft-web-rig-library-tutorial/package.json index 377c58c3dcd..d434eb7f278 100644 --- a/build-tests-samples/heft-web-rig-library-tutorial/package.json +++ b/build-tests-samples/heft-web-rig-library-tutorial/package.json @@ -24,6 +24,7 @@ "@types/heft-jest": "1.0.1", "@types/react-dom": "16.9.14", "@types/react": "16.14.23", + "@types/webpack-env": "1.13.0", "typescript": "~4.5.2" } } diff --git a/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json b/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json index fb08dbd90d8..bb41d01a056 100644 --- a/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json +++ b/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./node_modules/@rushstack/heft-web-rig/profiles/app/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest"] + "types": ["heft-jest", "webpack-env"] } } diff --git a/rigs/heft-web-rig/shared/webpack-base.config.js b/rigs/heft-web-rig/shared/webpack-base.config.js index d22509e246b..181284d96bf 100644 --- a/rigs/heft-web-rig/shared/webpack-base.config.js +++ b/rigs/heft-web-rig/shared/webpack-base.config.js @@ -193,8 +193,8 @@ function createWebpackConfig({ env, argv, projectRoot, configOverride }) { test: /\.(jpeg|jpg|png|gif|svg|ico)$/, // Allows import/require() to be used with an asset file. The file will be copied to the output folder, // and the import statement will return its URL. - // https://www.npmjs.com/package/file-loader - loader: 'file-loader' + // https://webpack.js.org/guides/asset-modules/#resource-assets + type: 'asset/resource' } ] },