Created
November 7, 2019 09:28
-
-
Save mascot6699/15a34a17aba29b83b42e57e5d8c220af to your computer and use it in GitHub Desktop.
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 path = require('path'); | |
module.exports = { | |
entry: './src/mytest.ts', | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
exclude: /(node_modules|bower_components)/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
"presets": ["@babel/typescript", ["@babel/env", { "modules": false }]], | |
"exclude": ["./node_modules/react-native/", "./node_modules/react/", "./node_modules/@babel/"], | |
"plugins": [["transform-class-properties"],["module-resolver", { | |
"root": ["./src/", "./node_modules/"], | |
"alias": { | |
"crypto": "crypto-browserify", | |
"stream": "stream-browserify" | |
} | |
}]] | |
} | |
} | |
}, | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
use: ["source-map-loader"], | |
enforce: "pre" | |
} | |
] | |
}, | |
"externals": { | |
"react": "require('react')", | |
"react-dom": "require('react-dom')" | |
}, | |
resolve: { | |
extensions: [".tsx", ".ts", ".js"] | |
}, | |
output: { | |
filename: 'main.js', | |
path: path.resolve(__dirname, 'dist'), | |
library: 'cruxpay', | |
libraryTarget: 'umd' | |
}, | |
node: { | |
fs: 'empty', | |
net: 'empty', | |
// crypto: 'empty', | |
Buffer: false, | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment