-
Notifications
You must be signed in to change notification settings - Fork 83
Import Components from "src" does not work #113
Comments
https://svelte-materialify.vercel.app/getting-started/installation/#advanced-install
and then in preprocess inside svelte
|
doesn't work for me either. even with the documented steps.
|
What are you using snowpack, rollup? show me the config file. |
I'm using snowpack.
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public: { url: '/', static: true },
src: { url: '/dist' },
},
plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-typescript'],
routes: [
],
optimize: {
bundle: true,
minify: true,
treeshake: true,
splitting: true,
},
packageOptions: {
},
devOptions: {
open: 'none', // don't open browser
output: 'stream', // don't clear the output
out: 'dist', // build to dist-directory
port: 3000,
},
buildOptions: {
},
};
const sveltePreprocess = require('svelte-preprocess');
module.exports = {
preprocess: sveltePreprocess({
scss: {
includePaths: ['theme''],
},
}),
}; |
Don't know what is wrong with your config, did you install |
yep these are all the packages i got installed:
|
@SuPuL Did the advanced install work on your end? |
@Florian-Schoenherr @TheComputerM Hey guys, Sorry for bothering and thx for your great work. |
No worries. Now we know there're problems with snowpack. |
@SuPuL I'm having exactly the same issue when using Snowpack and the workaround of importing individual Any ideas? |
Turns out, the issues with Snowpack are twofold, firstly, the so-called Looking into the issue of the css being skipped altogether, I find that Snowpack has issues using the scss preprocessor on Comparing different component packaging options, it turns out that https://github.com/hperrin/svelte-material-ui/tree/master/packages/button Taking this repo https://github.com/LeanderG/svelte-smui - it works using the snowpack provided /** @type {import("snowpack").SnowpackUserConfig } */
const { preprocess } = require('./snowpack.config'); // also sets up scss preprocessing ...
module.exports = {
mount: {
public: {url: '/', static: true},
src: {url: '/dist'},
},
plugins: [
'@snowpack/plugin-svelte',
'@snowpack/plugin-dotenv',
],
routes: [
/* Example: Enable an SPA Fallback in development: */
// {"match": "routes", "src": ".*", "dest": "/index.html"},
],
optimize: {
/* Example: Bundle your final build: */
// "bundle": true,
},
packageOptions: {
rollup: {
plugins: [
require('rollup-plugin-svelte')({
preprocess,
include: ['./node_modules'],
}),
require('rollup-plugin-postcss')({
use: [
[
'sass',
{
includePaths: ['./theme', './node_modules'],
},
],
],
}),
],
},
},
devOptions: {
/* ... */
},
buildOptions: {
/* ... */
},
}; |
Hi,
i've integrated
svelte-materialify
into my test app using the complete import withfrom svelte-materialify
. It's working without a problem.After that i tried to import the src directly following the instructions in the documentation. Import from
svelte-materialify/src
leads to this error:So i seems that the scss is not loaded correctly. I also tried to import all uses components with their specific index files like
Using this the app compiles but without the styles defined globally and in each component. I've included an own styles path and the
node_modules
folder in my preprocessing.Do i miss something? Or do you need more information?
Greetz and good luck with your exams!
The text was updated successfully, but these errors were encountered: