From fe8cfcbe47433f859466b8887609bc0edaa8ca9e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Fri, 11 Aug 2017 22:33:17 +0900 Subject: install babel and webpack --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore (limited to '.gitignore') diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ccbe46 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules/ -- cgit v1.2.3 From fe4b1bf362a563c7112ab8bc584e2a3c9284efc3 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Fri, 11 Aug 2017 23:15:47 +0900 Subject: add webpack.config --- .gitignore | 1 + src/index.js | 3 +++ src/module.js | 18 ++++++++++++++++++ webpack.config.js | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 src/index.js create mode 100644 src/module.js create mode 100644 webpack.config.js (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index 2ccbe46..d49756d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /node_modules/ +/build/ diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..8c9b627 --- /dev/null +++ b/src/index.js @@ -0,0 +1,3 @@ +import * as Module from './module'; + +Module.initialize() diff --git a/src/module.js b/src/module.js new file mode 100644 index 0000000..4378d0d --- /dev/null +++ b/src/module.js @@ -0,0 +1,18 @@ +const initialize = (url) => { + let p = document.createElement("p"); + p.textContent = "Hello Vim Vixen"; + p.style.position = 'fixed'; + p.style.right = '0'; + p.style.bottom = '0'; + p.style.padding = '0rem .5rem'; + p.style.margin = '0'; + p.style.backgroundColor = 'lightgray'; + p.style.border = 'gray'; + p.style.boxShadow = '0 0 2px gray inset'; + p.style.borderRadius = '3px'; + p.style.fontFamily = 'monospace'; + + document.body.append(p) +} + +export { initialize }; diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..4b3ed7a --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,32 @@ +var path = require('path'); + +const src = path.resolve(__dirname, 'src'); +const dist = path.resolve(__dirname, 'build'); + +module.exports = { + entry: { + index: path.join(src, 'index.js') + }, + + output: { + path: dist, + filename: '[name].js' + }, + + module: { + loaders: [ + { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel-loader', + query: { + presets: [ 'es2015' ] + } + } + ] + }, + + resolve: { + extensions: [ '.js' ] + } +}; -- cgit v1.2.3