diff --git a/source/application/tasks/build-bundles/index.js b/source/application/tasks/build-bundles/index.js
index <HASH>..<HASH> 100644
--- a/source/application/tasks/build-bundles/index.js
+++ b/source/application/tasks/build-bundles/index.js
@@ -57,11 +57,17 @@ export default async (application, settings) => {
 	}
 
 	// Get environments
-	const environments = await getEnvironments(base, {
+	const loadedEnvironments = await getEnvironments(base, {
 		cache,
 		log
 	});
 
+	// Environments have to apply on all patterns
+	const environments = loadedEnvironments.map(environment => {
+		environment.applyTo = '**/*';
+		return environment;
+	});
+
 	// Get available patterns
 	const availablePatterns = await getPatternMtimes(base, {
 		resolveDependencies: true
@@ -83,10 +89,17 @@ export default async (application, settings) => {
 			});
 
 			// Merge environment config into transform config
-			const config = merge({}, {
-				patterns: application.configuration.patterns,
-				transforms: application.configuration.transforms
-			}, {transforms: envConfig});
+			const config = merge(
+				{},
+				{
+					patterns: application.configuration.patterns,
+					transforms: application.configuration.transforms
+				},
+				envConfig,
+				{
+					environments: [environment.name]
+				}
+			);
 
 			// build all patterns matching the include config
 			const builtPatterns = await Promise.all(includedPatterns
fix: apply environment config to bundles properly

* environment config was merged into transforms
* environment config now is merged with whole pattern config

<URL>