angular-pdok-geocoder
Version:
AngularJS Geocoding PDOK Geocoder
74 lines (72 loc) • 1.87 kB
JavaScript
const path = require('path');
const webpack = require('webpack');
const Uglify = require("uglifyjs-webpack-plugin");
const WriteFilePlugin = require('write-file-webpack-plugin');
const BUILD_DIR = path.resolve(path.join(__dirname, "dist"));
module.exports = {
// Files to process
// resolve: {
// extensions: ['.js']
// },
entry: './app/components/searchbar/searchbar.module.js',
devtool: 'source-map',
output: {
filename: 'geocoder.js',
path: BUILD_DIR,
library: 'angularPdokGeocoder',
libraryTarget: 'umd'
},
plugins: [
new Uglify(),
new WriteFilePlugin(),
],
module: {
rules: [
// Allow css files to be imported in javascript/typescript
{
test: /\.css$/,
exclude: /(app)/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
]
},
// Import static files
{
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 10000
}
}
},
// Import more static files
{
test: /\.(eot|ttf)$/,
use: {
loader: 'file-loader'
}
},
// Transpile es6 javascript to es5. See .babelrc for further settings
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
},
{
test: /\.html$/, // Only .html files
loader: 'ngtemplate-loader!html-loader' // Run html loader
}
// {
// test: /\.html$/,
// loader: 'ngtemplate?relativeTo=' + (path.resolve(__dirname, './dist')) + '/!html'
// }
],
},
resolve: {
alias: {
angular: path.resolve(path.join(__dirname, 'node_modules', 'angular'))
}
},
}