-
Notifications
You must be signed in to change notification settings - Fork 1
feat: update webpack 3 to 4(working) #2
base: master
Are you sure you want to change the base?
Conversation
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.
まだ作業中
use: process.env.NODE_ENV == 'production' ? | ||
'css-loader?minimize' : 'css-loader', | ||
//TODO: process.env.NODE_ENV doesn't work | ||
use: process.env.NODE_ENV == 'production' |
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.
Webpack4になってどうすることになったんだっけか
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.
https://webpack.js.org/migrate/4/#mode
うーん、modeっていう変数あるのか・・・?
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.
- 一つのPRでいろいろやっちゃだめ。
- cssnanoはPostCSSで使ってください。cssnanoはそういう用途に設計されている。
- いらない変更があったりするので修正するときにはamendとforce-pushして。
|
|
やったけど( f941fcb ) 効果なくね? |
最後に |
play/main/webpack.config.js
Outdated
@@ -20,6 +20,9 @@ const path = require('path'); | |||
|
|||
module.exports = Object.assign({ | |||
entry: '.', | |||
externals: { | |||
electron: 'electron' |
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.
commonjs
としてだ。それではglobal scopeの electron
variable を参照してしまう。
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.
うん?言いたいことがわからん。今
const electron = require('electron');
としているんだから、globalにおけばいいんじゃないの(わかってない
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.
そうじゃなくて、 require('electron')
が単に electron
として置き換えられてしまうということ。
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.
diff --git a/play/main/webpack.config.js b/play/main/webpack.config.js
index 57d76ae..fd95b1e 100755
--- a/play/main/webpack.config.js
+++ b/play/main/webpack.config.js
@@ -21,7 +21,9 @@ const path = require('path');
module.exports = Object.assign({
entry: '.',
externals: {
- electron: 'electron'
+ electron: {
+ commonjs: 'electron'
+ }
}
output: {
filename: '[name].js',
こういうこと?エラーはあいかわらすだけど
あーもーだめだ(AMD)、さっぱりわからん。お手上げ。 |
ちなみにmakeはもちろんぶっ壊れているので治す必要がある。 |
で |
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.
今見たんだけど、コード自体は直せばいいとして、 extract-text-webpack-plugin
がまだbetaだからどのみち4に上げるのは反対だ。betaが外れてからでいい (2018ではやらない)
https://weblike-curtaincall.ssl-lolipop.jp/blog/?p=2094 |
そういえば |
Resolve #1