Webpack config fixups including react-intl

This commit is contained in:
Christopher Willis-Ford 2018-09-27 12:13:26 -07:00
parent 3785f7070e
commit c6a229f57f
4 changed files with 89 additions and 18 deletions

4
.gitignore vendored
View file

@ -3,3 +3,7 @@
dist/ dist/
node_modules/ node_modules/
thumbs.db thumbs.db
# generated translation files
/translations
/locale

82
package-lock.json generated
View file

@ -900,6 +900,15 @@
"@babel/plugin-transform-react-jsx-source": "7.0.0" "@babel/plugin-transform-react-jsx-source": "7.0.0"
} }
}, },
"@babel/runtime": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz",
"integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==",
"dev": true,
"requires": {
"regenerator-runtime": "0.12.1"
}
},
"@babel/template": { "@babel/template": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.0.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.0.tgz",
@ -1704,6 +1713,17 @@
} }
} }
}, },
"babel-plugin-react-intl": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-3.0.1.tgz",
"integrity": "sha512-FqnEO+Tq7kJVUPKsSG3s5jaHi3pAC4RUR11IrscvjsfkOApLP2DtzNo6dtQ+tX+OzEzJx7cUms8aCw5BFyW5xg==",
"dev": true,
"requires": {
"@babel/runtime": "7.0.0",
"intl-messageformat-parser": "1.4.0",
"mkdirp": "0.5.1"
}
},
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@ -3709,6 +3729,12 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -3740,6 +3766,12 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -6936,6 +6968,14 @@
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "1.2.0" "minimist": "1.2.0"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
} }
}, },
"jsonfile": { "jsonfile": {
@ -7306,6 +7346,14 @@
"read-pkg-up": "1.0.1", "read-pkg-up": "1.0.1",
"redent": "1.0.0", "redent": "1.0.0",
"trim-newlines": "1.0.0" "trim-newlines": "1.0.0"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
} }
}, },
"merge-descriptors": { "merge-descriptors": {
@ -7411,9 +7459,9 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.0", "version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true "dev": true
}, },
"mississippi": { "mississippi": {
@ -7510,14 +7558,6 @@
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
} }
}, },
"move-concurrently": { "move-concurrently": {
@ -7796,6 +7836,12 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -10677,6 +10723,14 @@
"ini": "1.3.5", "ini": "1.3.5",
"minimist": "1.2.0", "minimist": "1.2.0",
"strip-json-comments": "2.0.1" "strip-json-comments": "2.0.1"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
} }
}, },
"react": { "react": {
@ -10921,6 +10975,12 @@
"regenerate": "1.4.0" "regenerate": "1.4.0"
} }
}, },
"regenerator-runtime": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",
"integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==",
"dev": true
},
"regenerator-transform": { "regenerator-transform": {
"version": "0.13.3", "version": "0.13.3",
"resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz",

View file

@ -16,6 +16,7 @@
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0", "babel-eslint": "^10.0.0",
"babel-plugin-react-intl": "^3.0.1",
"electron": "2.0.7", "electron": "2.0.7",
"electron-builder": "^20.28.1", "electron-builder": "^20.28.1",
"electron-webpack": "^2.1.2", "electron-webpack": "^2.1.2",

View file

@ -6,22 +6,28 @@ module.exports = {
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
loader: 'babel-loader', loader: 'babel-loader',
// include: [path.resolve(__dirname, 'src', 'renderer'), /node_modules[\\/]scratch-[^\\/]+[\\/]src/], resolve: {
symlinks: false
},
include: [
path.resolve(__dirname, 'src', 'renderer'),
/node_modules[\\/]scratch-[^\\/]+[\\/]src/
],
options: { options: {
// Explicitly disable babelrc so we don't catch various config // Explicitly disable babelrc so we don't catch various config
// in much lower dependencies. // in much lower dependencies.
babelrc: false, babelrc: false,
cacheDirectory: true,
plugins: [ plugins: [
'@babel/proposal-object-rest-spread' '@babel/proposal-object-rest-spread',
// 'syntax-dynamic-import', // 'syntax-dynamic-import',
// 'transform-async-to-generator', // 'transform-async-to-generator',
// 'transform-object-rest-spread', ['react-intl', {
// ['react-intl', { messagesDir: './translations/messages/'
// messagesDir: './translations/messages/' }]
// }]
], ],
presets: [ presets: [
// ['env', {targets: {electron: '2.0.7'}}], ['@babel/env', {targets: {electron: '2.0.7'}}],
'@babel/react' '@babel/react'
] ]
} }