Skip to content

Commit

Permalink
update 1022 18:01
Browse files Browse the repository at this point in the history
  • Loading branch information
SPxiaomin committed Oct 22, 2017
1 parent d6ca6b9 commit b790d14
Show file tree
Hide file tree
Showing 11 changed files with 1,335 additions and 34 deletions.
7 changes: 7 additions & 0 deletions webpack/webpack-4/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
["env", {
"modules": false
}]
]
}
6 changes: 4 additions & 2 deletions webpack/webpack-4/app/Greeter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const config = require('./config.json');

module.exports = function() {
var greet = document.createElement('div');
greet.textContent = 'Hi there and greetings!';
let greet = document.createElement('div');
greet.textContent= config.greetText;
return greet;
};
3 changes: 3 additions & 0 deletions webpack/webpack-4/app/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"greetText": "Hi there and greetings from JSON!"
}
2 changes: 1 addition & 1 deletion webpack/webpack-4/app/main.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
var greeter = require('./Greeter');
const greeter = require('./Greeter');
document.querySelector('#root').appendChild(greeter());
Loading

0 comments on commit b790d14

Please sign in to comment.