Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Alewis/custom webpack config for sites #606

Merged
merged 1 commit into from
May 8, 2020

Conversation

ashleymichal
Copy link
Contributor

@ashleymichal ashleymichal commented Dec 17, 2019

fixes #602
please advise on verbiage. it felt easier to explain context than entry, but i could be convinced otherwise.

@ashleymichal ashleymichal requested a review from a team December 17, 2019 22:23
@ashleymichal ashleymichal self-assigned this Dec 17, 2019
@ashleymichal ashleymichal added this to the December 2019 milestone Dec 17, 2019
@ashleymichal ashleymichal force-pushed the alewis/custom-webpack-config-for-sites branch from 998110b to 180d961 Compare December 17, 2019 22:42
content/tooling/wrangler/webpack.md Outdated Show resolved Hide resolved
@juanmrad
Copy link

juanmrad commented Jan 4, 2020

A suggestion to give a broader example on this. and it is a suggestion, but wanted to put it here since is something I found out as I was testing:

you can have now the following folder structure:

common_modules
- common_module1
- common_module2
paths
- path1
- - index.js
- path2
- - index.js
webpack.path1.js
webpack.path2.js
wrangler.toml

This allowed us to have on the files:
webpack.path1.js:

module.exports = {
  target: 'webworker',
  entry: './paths/path1/index.js',
  mode: 'production'
};

and the index.js can easily import from the ../../modules/common_module1.js file.

This is great for monolith repos for multiple workers and paths.

@ashleymichal ashleymichal force-pushed the alewis/custom-webpack-config-for-sites branch from 80f52c4 to f6dfb36 Compare May 6, 2020 21:40
@ashleymichal ashleymichal requested a review from exvuma May 6, 2020 21:41
@ashleymichal ashleymichal force-pushed the alewis/custom-webpack-config-for-sites branch from be2da77 to ed2feb3 Compare May 8, 2020 15:08
@ashleymichal ashleymichal merged commit 5ee4ab8 into master May 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the alewis/custom-webpack-config-for-sites branch May 8, 2020 15:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

document how to use custom webpack configuration with workers sites
5 participants