Skip to content
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
2 changes: 1 addition & 1 deletion crates/pack-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ impl Project {
Ok(get_client_chunking_context(ClientChunkingContextOptions {
mode: self.mode(),
root_path: self.project_path().owned().await?,
output_root: self.dist_root().owned().await?,
output_root: self.client_root().owned().await?,
output_root_to_root_path: (*output_root_to_root_path).clone(),
public_path: self.config().computed_public_path(),
environment: self.client_compile_time_info().environment(),
Expand Down
62 changes: 32 additions & 30 deletions packages/pack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,46 @@ const { build, dev } = require('@utoo/pack');
// Production build
async function runBuild() {
await build({
mode: "production",
entry: [
{
import: "./src/index.ts",
html: {
template: "./index.html"
config: {
entry: [
{
import: "./src/index.ts",
html: {
template: "./index.html"
}
}
}
],
output: {
path: "./dist",
filename: "[name].[contenthash:8].js",
chunkFilename: "[name].[contenthash:8].js",
clean: true
},
sourceMaps: true
],
output: {
path: "./dist",
filename: "[name].[contenthash:8].js",
chunkFilename: "[name].[contenthash:8].js",
clean: true
},
sourceMaps: true
}
});
}

// Development mode with HMR
async function startDev() {
const server = await dev({
mode: "development",
entry: [
{
import: "./src/index.ts",
html: {
template: "./index.html"
config: {
entry: [
{
import: "./src/index.ts",
html: {
template: "./index.html"
}
}
}
],
output: {
path: "./dist",
filename: "[name].[contenthash:8].js",
chunkFilename: "[name].[contenthash:8].js",
clean: true
},
sourceMaps: true
],
output: {
path: "./dist",
filename: "[name].[contenthash:8].js",
chunkFilename: "[name].[contenthash:8].js",
clean: true
},
sourceMaps: true
}
});
}
```
Expand Down
Loading