Ver código fonte

fix webpack prod config

jmacura 5 anos atrás
pai
commit
c4c6ad74cb
3 arquivos alterados com 8 adições e 7 exclusões
  1. 1 0
      .gitignore
  2. 4 4
      package.json
  3. 3 3
      webpack.prod.js

+ 1 - 0
.gitignore

@@ -28,6 +28,7 @@ build/Release
 # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
 node_modules
 
+build
 static
 pidfile
 src/Attractivity.json

+ 4 - 4
package.json

@@ -2,13 +2,13 @@
   "name": "polirural-attractiveness",
   "version": "0.1.0",
   "description": "Rural attractiveness aplication",
-  "main": "index.html",
+  "main": "build/index.html",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
-    "build": "node node_modules/hslayers-ng/scripts/bootstrap-isolate.js && npx webpack --config src/webpack.prod.js --progress",
-    "build-dev": "node node_modules/hslayers-ng/scripts/bootstrap-isolate.js && npx webpack --config src/webpack.dev.js --progress",
+    "build": "node node_modules/hslayers-ng/scripts/bootstrap-isolate.js && npx webpack --config ./webpack.prod.js --progress",
+    "build-dev": "node node_modules/hslayers-ng/scripts/bootstrap-isolate.js && npx webpack --config ./webpack.dev.js --progress",
     "start": "npx http-server ./static -p 8080",
-    "start-dev": "npx webpack-dev-server --config src/webpack.dev.js --watch"
+    "start-dev": "npx webpack-dev-server --config ./webpack.dev.js --watch"
   },
   "repository": {
     "type": "git",

+ 3 - 3
webpack.prod.js

@@ -27,7 +27,7 @@ module.exports = merge(common, {
     // Add a chunkhash to file name so it will not be cached by browsers when content changed
     filename: '[name].[hash].bundle.js',
     // Path where bundled files will be output
-    path: path.resolve(__dirname, '../dist'),
+    path: path.resolve(__dirname, './build'),
     // Path at which output assets will be served
     publicPath: ''
   },
@@ -103,7 +103,7 @@ module.exports = merge(common, {
       {
         test: /\.json$/,
         type: 'javascript/auto',
-        include: path.resolve(__dirname, 'assets/locales'),
+        include: path.resolve(__dirname, 'src/assets/locales'),
         use: [
           {
             loader: 'file-loader',
@@ -117,7 +117,7 @@ module.exports = merge(common, {
       // AngularJS templates are cached using cache template
       {
         test: /\.html$/,
-        exclude: path.resolve(__dirname, '../src/index.html'),
+        exclude: path.resolve(__dirname, './src/index.html'),
         use: [
           'ng-cache-loader?prefix=[dir]/[dir]',
           'extract-loader',