diff --git a/dist/build-resources.js b/dist/build-resources.js index a483e00..37678ff 100644 --- a/dist/build-resources.js +++ b/dist/build-resources.js @@ -206,6 +206,7 @@ var assign = _assign2.default || require('object.assign'); var Promise = require('bluebird'); var cheerio = require('cheerio'); var execa = require('execa'); +var matcher = require('matcher'); var debug = require('debug')('webpack-plugin'); var debugDetail = require('debug')('webpack-plugin/details'); @@ -311,6 +312,20 @@ function getPackageAureliaResources(packageJson) { return packageJson && packageJson.aurelia && packageJson.aurelia.build && packageJson.aurelia.build.resources || []; } +function getPackageAureliaIncludeDependencies(packageJson) { + return packageJson && packageJson.aurelia && packageJson.aurelia.build && packageJson.aurelia.build.includeDependencies; +} + +function filterDepNames(names, patterns) { + if (!patterns) { + return names; + } + if (!Array.isArray(patterns)) { + patterns = [patterns]; + } + return matcher(names, patterns); +} + function getPackageMainDir(packagePath) { var packageJson = getPackageJson(packagePath); if (!packageJson) { @@ -525,7 +540,8 @@ function getResourcesOfPackage() { } if (packageJson.dependencies) { - for (var _iterator4 = (0, _getOwnPropertyNames2.default)(packageJson.dependencies), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var depNames = filterDepNames((0, _getOwnPropertyNames2.default)(packageJson.dependencies), getPackageAureliaIncludeDependencies(packageJson)); + for (var _iterator4 = depNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { @@ -547,7 +563,7 @@ function getResourcesOfPackage() { } if (!externalModule) { - for (var _iterator5 = (0, _getOwnPropertyNames2.default)(packageJson.dependencies), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + for (var _iterator5 = depNames, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref5; if (_isArray5) { diff --git a/dist/index.js b/dist/index.js index 8318646..d101dcb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45,10 +45,11 @@ var AureliaWebpackPlugin = function () { options.nameLocalModules = options.nameLocalModules == undefined || options.nameLocalModules == true; options.resourceRegExp = options.resourceRegExp || /aurelia-loader-context/; options.customViewLoaders = (0, _assign2.default)({ - '.css': ['css'], - '.scss': ['css', 'sass'], - '.less': ['css', 'less'], - '.styl': ['css', 'stylus'] + '.css': ['css-loader'], + '.scss': ['css-loader', 'sass-loader'], + '.sass': ['css-loader', 'sass-loader'], + '.less': ['css-loader', 'less-loader'], + '.styl': ['css-loader', 'stylus-loader'] }, options.customViewLoaders || {}); if (options.includeSubModules || options.contextMap) { diff --git a/package.json b/package.json index 3818891..ca1c5fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-webpack-plugin", - "version": "1.1.0", + "version": "1.2.0", "description": "A plugin for webpack that enables bundling Aurelia applications.", "keywords": [ "aurelia",