Could anyone point me in the right direction on se...
# general
r
Could anyone point me in the right direction on setting up the
package_json
target? I'd like to clean up how we're using
adhoc_tool
and
system_binary
now. I'll put my
BUILD
file in the thread. I think it should looks something like this:
Copy code
package_json(
    name="test_pkg",
    dependencies=[":tailwind"],
    scripts=[
        node_build_script(
            entry_point="build",
            output_directories=["src/python/apps/admin_webapp/theme/static"],
        )
    ],
)
Untitled
l
I would have thought that actually the dependencies defined as:
Copy code
javascript_sources(
    name="frontend-javascript-files",
    sources=["src/**/*.js", "src/**/*.jsx"],  # Add explicit patterns
)

typescript_sources(
    name="frontend-typescript-files",
    sources=["src/**/*.ts"],  # Add explicit patterns
)

tsx_sources(
    name="frontend-tsx-files",
    sources=["src/**/*.tsx"],  # Add explicit patterns
)

package_json(
    name="frontend-package",
    source="package.json",
    scripts = [
    node_build_script(
            entry_point="build",
            output_directories=[".next"],
            extra_env_vars=[
                # "NODE_ENV=production",
                "NEXT_TELEMETRY_DISABLED=1",  # optional: disables telemetry
            ],
        ),
        node_test_script(
            entry_point="lint",  # assuming you're using `next lint`
        ),
    ],
    dependencies = [
        ":frontend-javascript-files",
        ":frontend-typescript-files",
        ":frontend-tsx-files",
    ]
)
would mean that the files are there, but actually, it seems like they are not. Will try to use the
files(....)
target, but honestly a bit surprised that it doesnt work straight out of the box, especially when you look at their example repo
r
Yea I'm just trying to use it to bundle up some minors things for use in my Django app
l
but it looks like with this
Copy code
files(

    name="static_src",

    sources=["**/*", "!node_modules/**/*"],

)
you are loading the whole app through
files
r
That should be relative to the location of that BUILD file.