Skip to content

Instantly share code, notes, and snippets.

@PullJosh
Created January 28, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PullJosh/2dc16325f57106f2b4fce0f67e97858b to your computer and use it in GitHub Desktop.
Save PullJosh/2dc16325f57106f2b4fce0f67e97858b to your computer and use it in GitHub Desktop.
Exporting Component with Hooks: Package Settings
{
"presets": [
["@babel/react"],
["@babel/env", { "useBuiltIns": "usage" }]
]
}
{
"name": "atlas-editor",
"version": "1.0.0",
"description": "React-based code editor for the web",
"main": "build/editor.js",
"author": "Josh Pullen",
"license": "MIT",
"scripts": {
"prepublish": "rm -rf ./build && npm run build",
"build": "webpack"
},
"peerDependencies": {
"react": "^16.8.0-alpha.1",
"react-dom": "^16.8.0-alpha.1"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.5",
"webpack": "^4.29.0",
"webpack-cli": "^3.2.1"
},
"dependencies": {
"@babel/polyfill": "^7.2.5",
"classnames": "^2.2.6",
"clipboard-polyfill": "^2.7.0",
"memoize-one": "^5.0.0",
"moo": "^0.5.0"
}
}
var path = require('path')
module.exports = {
mode: 'production',
entry: './src/index.js',
output: {
path: path.resolve('build'),
filename: 'editor.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: 'babel-loader'
}
]
},
externals: {
'react': 'react',
'react-dom': 'react-dom'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment