Преглед на файлове

move webpack config to root
update file imports accordingly

jmacura преди 5 години
родител
ревизия
63a325247f
променени са 6 файла, в които са добавени 12 реда и са изтрити 12 реда
  1. 1 1
      src/adjuster/adjuster.service.js
  2. 1 1
      src/app.js
  3. 2 2
      src/nuts.js
  4. 6 6
      webpack.common.js
  5. 2 2
      webpack.dev.js
  6. 0 0
      webpack.prod.js

+ 1 - 1
src/adjuster/adjuster.service.js

@@ -1,5 +1,5 @@
 // import attractivity from '../Attractivity.json';
-import nuts from 'nuts';
+import nuts from '../nuts';
 
 export default ['Core', 'hs.utils.service', '$rootScope', '$http',
   function (Core, utils, $rootScope, $http) {

+ 1 - 1
src/app.js

@@ -16,7 +16,7 @@ import { OSM } from 'ol/source';
 import { Style, Stroke, Fill } from 'ol/style';
 import VectorLayer from 'ol/layer/Vector';
 import './adjuster/adjuster.module';
-import nuts from 'nuts';
+import nuts from './nuts';
 
 const module = angular.module('hs', [
   'hs.sidebar',

+ 2 - 2
src/nuts.js

@@ -1,7 +1,7 @@
 import { GeoJSON } from 'ol/format';
 import { Vector as VectorSource } from 'ol/source';
-import nuts2 from 'NUTS_RG_20M_2016_3857_LEVL_2.json';
-import nuts3 from 'NUTS_RG_20M_2016_3857_LEVL_3.json';
+import nuts2 from './NUTS_RG_20M_2016_3857_LEVL_2.json';
+import nuts3 from './NUTS_RG_20M_2016_3857_LEVL_3.json';
 
 export default {
   nuts2Source: new VectorSource({

+ 6 - 6
src/webpack.common.js → webpack.common.js

@@ -12,13 +12,13 @@
 const path = require('path');
 const CleanWebpackPlugin = require('clean-webpack-plugin');
 const HtmlWebpackPlugin = require('html-webpack-plugin');
-const hslPaths = require(path.join(__dirname, '../node_modules/hslayers-ng/common_paths'));
+const hslPaths = require(path.join(__dirname, './node_modules/hslayers-ng/common_paths'));
 
 module.exports = {
-  entry: { main: 'app.js' },
+  entry: { main: './src/app.js' },
   output: {
     // Path where bundled files will be output
-    path: path.resolve(__dirname, '../static'),
+    path: path.resolve(__dirname, './static'),
     // Path at which output assets will be served
     publicPath: ''
   },
@@ -27,8 +27,8 @@ module.exports = {
     symlinks: true,
     modules: [
       path.join(__dirname),
-      path.join(__dirname, '../node_modules'),
-      path.resolve(path.join(__dirname, '../node_modules', 'hslayers-ng'))
+      path.join(__dirname, './node_modules'),
+      path.resolve(path.join(__dirname, './node_modules', 'hslayers-ng'))
     ].concat(hslPaths.paths)
   },
   plugins: [
@@ -37,7 +37,7 @@ module.exports = {
     new HtmlWebpackPlugin({
       // Path where the file will be generated (appended to output.path)
       filename: 'index.html',
-      template: 'src/index.html',
+      template: './src/index.html',
       // We manually inject css and js files in our template
       inject: false
       // favicon: 'assets/img/favicon.ico'

+ 2 - 2
src/webpack.dev.js → webpack.dev.js

@@ -60,7 +60,7 @@ module.exports = merge(common, {
       // Load angularJS partials HTML file as URL
       {
         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',
@@ -82,7 +82,7 @@ module.exports = merge(common, {
       {
         type: 'javascript/auto',
         test: /\.json$/,
-        include: path.resolve(__dirname, 'assets/locales'),
+        include: path.resolve(__dirname, './src/assets/locales'),
         use: [
           {
             loader: 'file-loader',

+ 0 - 0
src/webpack.prod.js → webpack.prod.js