Skip to content

Commit 85f63ed

Browse files
Add babel and webpack support. Migrate scripts to package.json
1 parent 49a623c commit 85f63ed

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["stage-0"]
3+
}

_config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ kramdown:
2323
google_universal_analytics: UA-60941725-1
2424
google_universal_analytics_cookiedomain: auto
2525

26-
exclude: [vendor]
26+
exclude:
27+
- vendor
28+
- node_modules
29+
- package.json
30+
- webpack.config.js
31+
- Gemfile
32+
- Gemfile.lock
33+
- Rakefile
34+
- s3_website.yml
2735

2836
gems:
2937
- octopress-escape-code

assets/scripts/posts/d3-github.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import d3 from 'd3';

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,18 @@
1616
"dependencies": {
1717
"d3": "^3.5.12",
1818
"lodash": "^4.0.0"
19+
},
20+
"devDependencies": {
21+
"babel-core": "^6.3.15",
22+
"babel-loader": "^6.2.0",
23+
"babel-preset-es2015": "^6.3.13",
24+
"babel-preset-react": "^6.3.13",
25+
"babel-preset-stage-0": "^6.3.13",
26+
"webpack": "^1.12.9"
27+
},
28+
"scripts": {
29+
"test": "bundle exec htmlproof ./_site --url-ignore http://localhost:8080",
30+
"build": "jekyll build && webpack",
31+
"deploy": "npm run build && npm test && s3_website push"
1932
}
2033
}

webpack.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
entry: {
3+
'd3-github': './assets/scripts/posts/d3-github.js'
4+
},
5+
output: {
6+
path: './_site/assets/scripts/posts/',
7+
filename: '[name].bundle.js'
8+
},
9+
module: {
10+
loaders: [
11+
{
12+
test: /\.jsx?$/,
13+
exclude: /(node_modules|bower_components)/,
14+
loader: 'babel-loader',
15+
query: {
16+
presets: ['react', 'es2015', 'stage-0']
17+
}
18+
}
19+
]
20+
}
21+
};

0 commit comments

Comments
 (0)