Use this config with Haul, the Webpack packager for React Native.
Last active
August 4, 2019 03:31
-
-
Save bkonkle/235463bc161c78ef4a881a422522a88a to your computer and use it in GitHub Desktop.
PureScript + purs-loader + webpack-blocks + Haul + React Native
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"test": "jest", | |
"start": "haul start" | |
}, | |
"dependencies": { | |
"@purescript/prelude": "^3.0.0", | |
"purescript-mini-redux": "^3.0.4", | |
"purescript-recompose": "^1.1.0", | |
"react": "16.0.0-alpha.6", | |
"react-native": "0.44.0", | |
"react-redux": "^5.0.4", | |
"recompose": "^0.23.1", | |
"redux": "^3.6.0" | |
}, | |
"devDependencies": { | |
"@purescript/psci-support": "^3.0.0", | |
"@webpack-blocks/webpack2": "^0.4.0", | |
"babel-eslint": "^7.2.3", | |
"babel-jest": "19.0.0", | |
"babel-preset-react-native": "1.9.1", | |
"eslint": "^3.19.0", | |
"eslint-config-standard": "^10.2.1", | |
"eslint-config-standard-jsx": "^4.0.1", | |
"eslint-config-standard-react": "^5.0.0", | |
"eslint-plugin-import": "^2.2.0", | |
"eslint-plugin-node": "^4.2.2", | |
"eslint-plugin-promise": "^3.5.0", | |
"eslint-plugin-react": "^7.0.0", | |
"eslint-plugin-react-native": "^2.3.2", | |
"eslint-plugin-standard": "^3.0.1", | |
"haul-cli": "^0.5.0", | |
"jest": "19.0.2", | |
"purs-loader": "^3.0.0", | |
"react-test-renderer": "16.0.0-alpha.6", | |
"webpack-blocks-utils": "^1.3.1" | |
}, | |
"jest": { | |
"preset": "react-native" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
createConfig, | |
customConfig, | |
defineConstants, | |
} = require('@webpack-blocks/webpack2') | |
const {resolveModules} = require('webpack-blocks-utils') | |
const path = require('path') | |
module.exports = ({platform}, defaults) => | |
createConfig.vanilla([ | |
customConfig(defaults), | |
customConfig({entry: `./index.${platform}.js`}), | |
customConfig({ | |
module: { | |
rules: [ | |
{ | |
test: /\.purs$/, | |
loader: 'purs-loader', | |
query: { | |
psc: 'psa', | |
src: [ | |
'node_modules/@purescript/*/src/**/*.purs', | |
'node_modules/purescript-*/src/**/*.purs', | |
'src/**/*.purs', | |
], | |
}, | |
}, | |
], | |
}, | |
}), | |
// Allow centralized imports | |
resolveModules([path.resolve('./src'), path.resolve('./node_modules')]), | |
// Replace references to environment variables | |
defineConstants({ | |
'process.env.NODE_ENV': process.env.NODE_ENV || 'production', | |
}), | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment