'use strict'; let webpack = require('webpack'); let HTMLWebpackPlugin = require('html-webpack-plugin'); let postcss_cssnext = require('postcss-cssnext'); let path = require('path'); function _path(p) { return path.join(__dirname, p); } module.exports = { entry: { app: './index.js', }, output: { filename: '[name].js', }, module: { preLoaders: [ { test: /\.js$/, loader:'source-map', }, ], loaders: [ { test: /\.js$/, loader: 'babel', exclude: /(node_modules)/, query: { presets: [ 'es2015', 'stage-0', ], passPerPreset: true, }, }, { test: /\.css$/, loader: 'style!css?importLoaders=1!postcss', }, ], }, postcss: [postcss_cssnext], resolve: { alias: { // jquery is NOT a peer dependency in jquery.inputmask so a alias // is used here to force jquery.inputmask to use your jquery // version 'jquery': _path('node_modules/jquery/dist/jquery'), // Switch dependency lib accordingly (this one uses jquery) 'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib'), // Core library (order of these aliases shouldn't matter FYI) 'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'), // Allows use of jquery input mask via jquery chaining api/$('selector').inputmask(...) 'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'), // Add extensions following the pattern below remember to import them as necessary in your .js files 'inputmask.numeric.extensions': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'), }, }, plugins: [ new webpack.SourceMapDevToolPlugin( '[file].map', null, '[absolute-resource-path]', '[absolute-resource-path]' ), new HTMLWebpackPlugin({ title: 'Inputmask', template: 'index.ejs', filename: 'index.html', inject: 'head', chunks: 'app', }), ], bail: true, debug: true, devServer: { publicPath: '/', outputPath: _path('build'), stats: {colors: true}, host: '0.0.0.0', inline: true, port: '8090', quiet: false, noInfo: false, }, };