diff --git a/.gitignore b/.gitignore index ae342fe..04c01ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,2 @@ node_modules/ -/service-worker.js -/index.html -/assets/ -/workbox-*.js -/bundle.js -/manifest.json -/sw.js \ No newline at end of file +dist/ \ No newline at end of file diff --git a/package.json b/package.json index a3532ec..3c6e22e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "webpack", "predeploy": "npm run build", - "deploy": "gh-pages -d .", + "deploy": "gh-pages -d dist", "dev": "webpack serve --open --mode=development", "start": "http-server -p 3000", "test": "echo \"Error: no test specified\" && exit 1" diff --git a/webpack.config.js b/webpack.config.js index 2f1e75e..e608791 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,9 +24,9 @@ module.exports = { output: { filename: ({runtime}) => { if (runtime === 'sw') { - return '[name].js'; + return 'dist/[name].js'; } - return 'bundle.js'; + return 'dist/bundle.js'; }, path: path.resolve(__dirname) }, @@ -36,9 +36,9 @@ module.exports = { plugins: [ new CopyPlugin({ patterns: [ - { from: "src/index.html", to: "index.html" }, - { from: "src/manifest.json", to: "manifest.json" }, - { from: "src/assets", to: "assets" } + { from: "src/index.html", to: "dist/index.html" }, + { from: "src/manifest.json", to: "dist/manifest.json" }, + { from: "src/assets", to: "dist/assets" } ] }) ]