Open cleverboy32 opened 5 years ago
@cleverboy32 do you observe any PostCSS-related errors in the console?
no . nothing console. it show Compiled successfully
@cleverboy32 how do you see that the icon is not found?
because the graph not show
i use a star icon , but the render shape is a
and real icon is this
@cleverboy32 but what about som-ui-icons.woff font itself? Is it being loaded? Because the problem might be with the font itself.
is i use this url('../../node_modules/@souche-ui/som-ui/src/styles/fonts/som-ui-icons.woff?t=1472440741') it can success.
and i use reslove ,try all the prossible path, but it just no error to log, so i cant konw why
What does the resulting CSS look like?
the css look like right
i cant see is the font file be loaded. the reason look like the file not be load.
@cleverboy32 what about this part? How does it look like in the compiled CSS?
src: resolve('fonts/som-ui-icons.woff?t=1472440741') format('woff'),
resolve('fonts/som-ui-icons.ttf?t=1472440741') format('truetype');
oh, it still src: resolve(...)
it not be parse.
my postcss.config.js and i use webpack
module.exports = {
plugins: [
require('postcss-assets')({
loadPaths: ['../../node_modules/@souche-ui/som-ui/src/styles/']
})
]
}
@cleverboy32 well, it does look to me that your file is not being processed by PostCSS at all.
By design, PostCSS Assets is never expected to keep those resolve
functions intact. And if it can't resolve something an error should be thrown. Considering none of that happens I suspect that the problem is with the Webpack config itself, not with the PostCSS Assets.
Could you publish an example setup somewhere which I can use to reproduce the issue myself? I can try to help.
i did this. thank for you helping.
the post plugin i put it at the last step, and it will can parse. seem like it need the file convert totally, the plugin can Become effective。
module.exports = {
plugins: [
require('postcss-import')({
resolve: createResolver({
alias: {
'lemon': '@souche-ui/lemon',
'som-ui': '@souche-ui/som-ui'
},
modules: ['src', 'node_modules']
})
}),
require('saladcss-bem')({
defaultNamespace: 'som',
separators: {
descendent: "__"
},
shortcuts: {
modifier: "m",
descendent: "d",
component: "c"
}
}),
require('postcss-mixins'),
require('precss'),
require('postcss-shape'),
require('postcss-utils'),
require('postcss-preset-env')({
stage: 0,
browsers: ['ie > 8', 'iOS >= 7', 'Android >= 4.1', 'Safari >= 6']
}),
require('cssnano'),
require('postcss-assets')({
basePath: 'node_modules/@souche-ui/som-ui/src/styles',
relative: true
}),
]
};
my config
my css
it can complied and run, but my icon not found. i try some other features too , i aslo no use. why - -