Build package for web use without config
build commonjs and module files so this package can be used in web without modifying webpack config
write something like following so source file would be used in react-native
"main": "lib/commonjs/index.js",
"react-native": "src/index.tsx",
"source": "src/index.tsx",
"module": "lib/module/index.js",
I have the same problem. Indeed, files from the js/ folder have a .js extension, but use Typescript, Flow and ES6 features that webpack needs to compile.
I can't figure out how I can make this happen, has anyone else the same problem?
@pybuche I am using the react-native-picker-select library and was running into the same issue. I used the transform-flow-strip-types plugin with the babel loader on a few of the files and it fix the build error for me. Hopefully this helps you too.
module: {
rules: [
/// other rules
{
test: /react-native-(picker|web)(-select)?.*\.jsx?$/,
use: {
loader: 'babel-loader',
options: {
plugins: [
'@babel/plugin-proposal-class-properties',
'transform-flow-strip-types'
]
}
}
}
]
}
:tada: This issue has been resolved in version 2.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 2.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket: