Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add sourceMaps to dev-builds #1134

Merged
merged 1 commit into from
Jan 24, 2023
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"ci:lint": "npm run lint",
"beta-build": "docker rmi -f ipfs-companion-beta-build && docker build -t ipfs-companion-beta-build --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=$(id -g ${USER}) . && mkdir -p build && docker run --rm --net=host -e RELEASE_CHANNEL=beta -v $(pwd)/build:/home/node/app/build ipfs-companion-beta-build npm run ci:build",
"release-build": "docker rmi -f ipfs-companion-release-build && docker build -t ipfs-companion-release-build --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=$(id -g ${USER}) . && mkdir -p build && docker run --rm --net=host -e RELEASE_CHANNEL=stable -v $(pwd)/build:/home/node/app/build ipfs-companion-release-build npm run ci:build",
"dev-build": "npm ci && npm run build",
"dev-build": "npm ci && cross-env NODE_ENV='development' npm run build",
"yarn-build": "npm run dev-build",
"compose:e2e:prepare": "docker compose --file docker-compose.e2e.yml pull && docker compose --file docker-compose.e2e.yml build",
"compose:e2e:up": "docker compose --file docker-compose.e2e.yml up --remove-orphans --detach kubo chromium firefox",
Expand Down
26 changes: 22 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const require = createRequire(import.meta.url)

const __dirname = path.dirname(fileURLToPath(import.meta.url))

// common configuration shared by all targets
const devBuild = process.env.NODE_ENV === 'development'

/**
* common configuration shared by all targets
* @type {import('webpack').Configuration}
*/
const commonConfig = {
target: 'web',
bail: true,
Expand Down Expand Up @@ -110,7 +115,14 @@ const commonConfig = {
}
}

// background page bundle (with heavy dependencies)
if (devBuild) {
commonConfig.devtool = 'source-map'
}

/**
* background page bundle (with heavy dependencies)
* @type {import('webpack').Configuration}
*/
const bgConfig = merge(commonConfig, {
name: 'background',
entry: {
Expand All @@ -134,7 +146,10 @@ const bgConfig = merge(commonConfig, {
}
})

// user interface pages with shared common libraries
/**
* user interface pages with shared common libraries
* @type {import('webpack').Configuration}
*/
const uiConfig = merge(commonConfig, {
name: 'ui',
entry: {
Expand All @@ -161,7 +176,10 @@ const uiConfig = merge(commonConfig, {
}
})

// content scripts injected into tabs
/**
* content scripts injected into tabs
* @type {import('webpack').Configuration}
*/
const contentScriptsConfig = merge(commonConfig, {
name: 'contentScripts',
entry: {
Expand Down