From 8ff200755f6b3661c405b14fe1ff6dc5b0f17dbd Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 4 Feb 2018 17:44:40 +0900 Subject: [PATCH] add ambassador extension --- .gitignore | 1 + e2e/ambassador/src/background/index.js | 0 e2e/ambassador/src/content/index.js | 0 e2e/ambassador/webpack.config.js | 37 ++++++++++++++++++++++++++ package.json | 4 ++- 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 e2e/ambassador/src/background/index.js create mode 100644 e2e/ambassador/src/content/index.js create mode 100644 e2e/ambassador/webpack.config.js diff --git a/.gitignore b/.gitignore index 2515a99..07d22c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules/ /build/ +/e2e/ambassador/build/ *.zip diff --git a/e2e/ambassador/src/background/index.js b/e2e/ambassador/src/background/index.js new file mode 100644 index 0000000..e69de29 diff --git a/e2e/ambassador/src/content/index.js b/e2e/ambassador/src/content/index.js new file mode 100644 index 0000000..e69de29 diff --git a/e2e/ambassador/webpack.config.js b/e2e/ambassador/webpack.config.js new file mode 100644 index 0000000..2a544bf --- /dev/null +++ b/e2e/ambassador/webpack.config.js @@ -0,0 +1,37 @@ +const path = require('path'); + +const src = path.resolve(__dirname, 'src'); +const dist = path.resolve(__dirname, 'build'); + +config = { + entry: { + content: path.join(src, 'content'), + background: path.join(src, 'background') + }, + + output: { + path: dist, + filename: '[name].js' + }, + + module: { + loaders: [ + { + test: [ /\.js$/ ], + exclude: /node_modules/, + loader: 'babel-loader', + query: { + presets: ['es2015'] + } + } + ] + }, + + resolve: { + extensions: [ '.js' ], + modules: [path.join(__dirname, 'src'), 'node_modules'] + } +}; + +module.exports = config + diff --git a/package.json b/package.json index 1391496..0a48e3a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "build": "NODE_ENV=production webpack --progress --display-error-details", "package": "npm run build && script/package.sh", "lint": "eslint --ext .jsx,.js src", - "test": "karma start" + "test": "karma start", + "ambassador:start": "webpack -w --debug --context --devtool inline-source-map", + "ambassador:build": "webpack --context e2e/ambassador" }, "repository": { "type": "git",