Skip to content

Commit

Permalink
Fix webpack build with sourcemaps and correct dir
Browse files Browse the repository at this point in the history
  • Loading branch information
raitisbe committed Nov 6, 2019
1 parent 70d2e24 commit fa75a2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions app.js
Expand Up @@ -33,13 +33,12 @@ module.directive('hs', ['config', 'Core', function (config, Core) {
return {
template: require('hslayers.html'),
link: function (scope, element, attrs) {
Core.fullScreenMap(element);
if(typeof config.sizeMode == 'undefined' || config.sizeMode == 'fullscreen')
Core.fullScreenMap(element);
}
};
}]);

if (window.hslayersNgConfig) module.value('config', Object.assign({}, window.hslayersNgConfig(ol)));

import {Tile, Group, Image as ImageLayer} from 'ol/layer';
import VectorLayer from 'ol/layer/Vector';
import {Vector} from 'ol/source';
Expand All @@ -50,7 +49,7 @@ import * as proj from 'ol/proj';
import View from 'ol/View';
import { Polygon, LineString, GeometryType, Point } from 'ol/geom';
import Feature from 'ol/Feature';

import GeoJSON from 'ol/format/GeoJSON';

window.ol = {
layer: {
Expand All @@ -70,12 +69,17 @@ window.ol = {
ImageWMS,
ImageArcGISRest
},
format: {
GeoJSON
},
View,
proj
};

module.controller('Main', ['$scope', 'Core', 'hs.addLayersWms.service_layer_producer', 'hs.compositions.service_parser', 'config',
function ($scope, Core, srv_producer, composition_parser, config) {
if (window.hslayersNgConfig) module.value('config', Object.assign({}, window.hslayersNgConfig(window.ol)));

module.controller('Main', ['$scope', 'Core', 'config',
function ($scope, Core, config) {
$scope.Core = Core;
Core.singleDatasources = true;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack.dev.js
Expand Up @@ -13,7 +13,7 @@ const path = require('path');

module.exports = merge(common, {
mode: 'development',
devtool: 'cheap-eval-source-map',
devtool: 'source-map',
watchOptions: { ignored: /node_modules/ },
optimization: {
// see https://webpack.js.org/guides/build-performance#avoid-extra-optimization-steps
Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack.prod.js
Expand Up @@ -26,7 +26,7 @@ module.exports = merge(common, {
output: {
// Add a chunkhash to file name so it will not be cached by browsers when content changed
filename: 'hslayers-ng.js',
path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, '../dist'),
library: 'hslayers-ng',
libraryTarget: 'umd'
},
Expand Down

0 comments on commit fa75a2c

Please sign in to comment.