Skip to content

Commit

Permalink
[#208] 🔧chore: got webpack to work with babel
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanLin-TWer committed Jun 24, 2018
1 parent 4f41378 commit 36f515e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
node_modules
npm-debug.log

# Dist
dist

# Coverage
coverage/
coverage
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
"lint:watch": "esw index.js src/react --watch",
"test": "jest",
"test:watch": "npm test -- --watch",
"test:ci": "npm test -- --coverage --verbose"
"test:ci": "npm test -- --coverage --verbose",
"build": "cd src/react && webpack --mode development --config webpack.config.js"
},
"devDependencies": {
"babel-core": "^7.0.0-beta.3",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^7.0.0-beta.3",
"babel-preset-react": "^7.0.0-beta.3",
"eslint": "^4.19.1",
Expand Down
22 changes: 22 additions & 0 deletions src/react/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const path = require('path')

module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js',
// TODO: [Linesh][2018/6/24] not quite modularized to put dist in two upper directories
path: path.resolve(__dirname, '../../dist'),
},

module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
}

0 comments on commit 36f515e

Please sign in to comment.