svelte-loader
Advanced tools
Comparing version 3.1.7 to 3.1.8
16
index.js
@@ -5,3 +5,3 @@ const path = require('path'); | ||
const { buildMakeHot } = require('./lib/make-hot.js'); | ||
const { compile, preprocess } = require('svelte/compiler'); | ||
const { compile, preprocess, VERSION } = require('svelte/compiler'); | ||
@@ -57,2 +57,4 @@ function posixify(file) { | ||
let warned = false; | ||
module.exports = function(source, map) { | ||
@@ -77,5 +79,13 @@ this.cacheable(); | ||
css: !options.emitCss, | ||
...options.compilerOptions, | ||
format: (options.compilerOptions && options.compilerOptions.format) || 'esm' | ||
...options.compilerOptions | ||
}; | ||
if (VERSION[0] === '3') { | ||
compileOptions.format = (options.compilerOptions && options.compilerOptions.format) || 'esm' | ||
} else { | ||
if (options.compilerOptions && options.compilerOptions.format && !warned) { | ||
warned = true; | ||
console.warn(`[svelte-loader] Svelte's "format" compiler option was removed in version 4, the output is always ESM now.` + | ||
` Remove the format option from your webpack config to remove this warning.`); | ||
} | ||
} | ||
@@ -82,0 +92,0 @@ const handleWarning = warning => this.emitWarning(new Error(warning)); |
{ | ||
"name": "svelte-loader", | ||
"version": "3.1.7", | ||
"version": "3.1.8", | ||
"author": "Nico Rehwaldt <git_nikku@nixis.de>", | ||
@@ -26,3 +26,3 @@ "description": "A webpack loader for svelte", | ||
"eslint-plugin-mocha": "^8.0.0", | ||
"mocha": "^8.2.1", | ||
"mocha": "^10.2.0", | ||
"sinon": "^9.2.3", | ||
@@ -33,3 +33,3 @@ "sinon-chai": "^3.5.0", | ||
"peerDependencies": { | ||
"svelte": ">3.0.0" | ||
"svelte": "^3.0.0 || 4.0.0-next.0 || 4.0.0-next.1 || ^4.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "repository": { |
@@ -30,3 +30,3 @@ > Undecided yet what bundler to use? We suggest using [SvelteKit](https://kit.svelte.dev), or Vite with [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte/). | ||
mainFields: ['svelte', 'browser', 'module', 'main'], | ||
conditionNames: ['svelte'] | ||
conditionNames: ['svelte', 'browser'] | ||
}, | ||
@@ -33,0 +33,0 @@ module: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20850
216