Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const webpack = require('webpack');
const path = require('path');
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { alias, extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
dev,
hydratable: true,
hotReload: false // pending https://github.com/sveltejs/svelte/issues/2377
}
}
}
]
const webpack = require('webpack');
const config = require('sapper/config/webpack.js');
const preprocess = require('svelte-preprocess')({ postcss: true });
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
preprocess,
dev,
hydratable: true,
hotReload: false, // pending https://github.com/sveltejs/svelte/issues/2377
},
},
},
});
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const commonRules = require('./webpack-common-rules');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { alias, extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
dev,
hydratable: true,
hotReload: false, // pending https://github.com/sveltejs/svelte/issues/2377
preprocess
}
}
},
const webpack = require('webpack');
const path = require('path');
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { alias, extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
dev,
hydratable: true,
hotReload: false // pending https://github.com/sveltejs/svelte/issues/2377
}
}
}
]
},
const cssConfig = {
test: /\.css$/,
oneOf: [
{
test: /\.module\.css$/,
use: [MiniCssExtractPlugin.loader, { loader: "css-loader", options: { modules: true, exportOnlyLocals: false } }]
},
{
use: [MiniCssExtractPlugin.loader, "css-loader"]
}
]
};
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { extensions, mainFields },
module: {
rules: [
cssConfig,
{
test: /\.(svelte|html)$/,
use: {
loader: "svelte-loader",
options: {
dev,
hydratable: true,
hotReload: false // pending https://github.com/sveltejs/svelte/issues/2377
}
}
}
test: /\.css$/,
oneOf: [
{
test: /\.module\.css$/,
use: [MiniCssExtractPlugin.loader, { loader: "css-loader", options: { modules: true, exportOnlyLocals: false } }]
},
{
use: [MiniCssExtractPlugin.loader, "css-loader"]
}
]
};
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { extensions, mainFields },
module: {
rules: [
cssConfig,
{
test: /\.(svelte|html)$/,
use: {
loader: "svelte-loader",
options: {
dev,
hydratable: true,
hotReload: false // pending https://github.com/sveltejs/svelte/issues/2377
}
}
}
]
const webpack = require('webpack');
const config = require('sapper/config/webpack.js');
const preprocess = require('svelte-preprocess')({ postcss: true });
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
preprocess,
dev,
hydratable: true,
hotReload: false, // pending https://github.com/sveltejs/svelte/issues/2377
},
},
},
],
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const commonRules = require('./webpack-common-rules');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { alias, extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
dev,
hydratable: true,
hotReload: false, // pending https://github.com/sveltejs/svelte/issues/2377
preprocess
}
}
},
commonRules.babel,