Skip to content

Commit

Permalink
making WebWorker webpack setup working
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigran committed Aug 30, 2018
1 parent 722cf7f commit 3e320f0
Show file tree
Hide file tree
Showing 6 changed files with 2,042 additions and 592 deletions.
10 changes: 7 additions & 3 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = {
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: {

// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
Expand Down Expand Up @@ -115,13 +115,17 @@ module.exports = {
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),

},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
test: /\.worker\.js$/,
use: { loader: 'worker-loader' }
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
Expand All @@ -144,7 +148,7 @@ module.exports = {
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {

// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
Expand Down
10 changes: 7 additions & 3 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = {
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
alias: {

// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
Expand Down Expand Up @@ -121,13 +121,17 @@ module.exports = {
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),

},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
test: /\.worker\.js$/,
use: { loader: 'worker-loader' }
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
Expand All @@ -149,7 +153,7 @@ module.exports = {
include: paths.appSrc,
loader: require.resolve('babel-loader'),
options: {

compact: true,
},
},
Expand Down
Loading

0 comments on commit 3e320f0

Please sign in to comment.