-
Notifications
You must be signed in to change notification settings - Fork 19
chore: Remove devtools and switch to pwa-buildpack #35
Conversation
The +10,000 is all in package-lock.json. :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right idea to simplify webpack configuration. Just a few minor changes to consider.
@@ -1,3 +1,5 @@ | |||
MOCK_IMAGES_PATH="https://magento-ux.github.io/pwaza" | |||
MAGENTO_HOST="https://magento2.vagrant89" | |||
|
|||
MAGENTO_HOST="https://localhost:8443" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was originally pointing to the vagrant box. Now it points to localhost. If I'm using vagrant, what should the value of MAGENTO_HOST
be?
MAGENTO_HOST="https://magento2.vagrant89" | ||
|
||
MAGENTO_HOST="https://localhost:8443" | ||
MAGENTO_PUBLIC_PATH="/pub/static/frontend/Magento/venia/en_US/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of writing, this theme is still called rush
, so I think venia
won't work in this path.
@@ -32,9 +32,8 @@ | |||
"redux": "^3.7.2" | |||
}, | |||
"devDependencies": { | |||
"@magento/anhinga": "^0.2.0", | |||
"@magento/pwa-buildpack": "^0.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this to @jzetlen/pwa-buildpack
for now?
MagentoResolver, | ||
PWADevServer | ||
} | ||
} = require('@magento/pwa-buildpack'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This certainly works, but nested destructuring is a bit difficult to read. Maybe we could change this to the following?
const { Webpack } = require(...);
const { ..., PWADevServer } = Webpack;
src: resolve(__dirname, 'src'), | ||
assets: resolve(__dirname, 'web'), | ||
output: resolve(__dirname, 'web/js') | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
new webpack.NoEmitOnErrorsPlugin(), | ||
new webpack.EnvironmentPlugin({ | ||
NODE_ENV: isProd ? 'production' : 'development', | ||
SERVICE_WORKER_FILE_NAME: magentoEnv.serviceWorkerFileName | ||
SERVICE_WORKER_FILE_NAME: 'sw.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there an environment variable for this?
@zetlen I think a good chunk of these changes have made their way into the repo. Is there still work in here needing to get merged? |
@DrewML Nope! This branch is no longer necessary. Thanks for looking over it. |
Removes the inline
devtools
directory and replaces it with imports from@magento/pwa-buildpack
.Changes
webpack.config.js
to use PWADevServer and ServiceWorkerPlugin.