Skip to content

Instantly share code, notes, and snippets.

@dimgeorgiev1976
Last active November 21, 2019 20:23
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 dimgeorgiev1976/40666076c4164be1af9cf2b60489a2d8 to your computer and use it in GitHub Desktop.
Save dimgeorgiev1976/40666076c4164be1af9cf2b60489a2d8 to your computer and use it in GitHub Desktop.
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"]
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
:~$ npm install --save-dev @babel/core @babel/node @babel/cli @babel/preset-env @babel/plugin-transform-runtime @babel/runtime babel-loader webpack webpack-dev-server webpack-cli
:~$ npm install -g @babel/core @babel/node @babel/cli @babel/preset-env @babel/plugin-transform-runtime @babel/runtime babel-loader
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src='/dist/app.js'></script>
</body>
</html>
"scripts": {
"test": "mocha --require @babel/register",
"serve": "webpack-dev-server --mode development",
"nodemon": "nodemon --exec babel-node server.js",
"build": "webpack --mode production"
},
const path = require('path')
module.exports = {
entry: {
app: './src/index.js'
},
output: {
filename: '[name].js',
path: path.join(__dirname, '/dist'),
publicPath: '/dist'
},
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: '/node_modules/'
}]
},
devServer: {
overlay: true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment