You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the React example open in a PR. React + TS works fine, importing Material does not.
🔬 Minimal Reproduction
// app.tsximport*asReactfrom'react';import*asReactDOMfrom'react-dom';import{Button}from'@material-ui/core';functionApp(){return(<Buttonvariant="contained"color="primary">
Hello World
</Button>);}ReactDOM.render(<App/>,document.querySelector('#root'));
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle", "nodejs_binary")
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
load("@npm_bazel_typescript//:index.bzl", "ts_config", "ts_devserver", "ts_library")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "components",
srcs = glob([
"components/*.ts",
"components/*.tsx",
]),
deps = [
"@npm//@types/react",
"@npm//@types/react-dom",
],
)
ts_library(
name = "app",
srcs = glob([
"*.ts",
"*.tsx",
]),
deps = [
":components",
"@npm//@types/react",
"@npm//@types/react-dom",
"@npm//@material-ui/core",
],
)
ts_devserver(
name = "devserver",
index_html = "index.html",
entry_module = "com_etsy_search/apps/tire-ui/app",
# We'll collect all the devmode JS sources from these TypeScript libraries
deps = [
":app",
"@npm//react:react__umd",
"@npm//react-dom:react-dom__umd",
"@npm//@material-ui/core:core__umd",
],
)
rollup_bundle(
name = "bundle",
enable_code_splitting = False,
entry_point = ":app.ts",
deps = [
":app",
"@npm//react",
"@npm//react-dom",
"@npm//@material-ui/core",
],
)
web_package(
name = "package",
assets = [
# For differential loading, we supply both an ESModule entry point and an es5 entry point
# The injector will put two complimentary script tags in the index.html
":bundle.min.js",
":bundle.min.es2015.js",
],
index_html = "index.html",
)
🐞 bug report
Affected Rule
The issue is caused by the rule:ts_devserver
orrollup_bundle
.Possibly related to issue #1095
Is this a regression?
Did not use prior version.
Description
While attempting to include @material-ui/core in the generated bundle for devserver, I receive a 404 error attempting to fetch core.js.
Looking in the generated bazel for material-ui/core, I see:
I followed the React example open in a PR. React + TS works fine, importing Material does not.
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules version (SHA):
Anything else relevant?
The text was updated successfully, but these errors were encountered: