You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im passing a custom generateScopedName using interpolation (https://github.com/madyankin/postcss-modules) and it is not even running. If I change it to modules: true, it works as expected. But I really need to change the name of the classes. I want to append the component's name as a prefix on every class instead of adding a non human hash.
// rollup.config.jsimportfsfrom"fs";importpathfrom"path";importvuefrom"rollup-plugin-vue";importaliasfrom"@rollup/plugin-alias";importcommonjsfrom"@rollup/plugin-commonjs";importresolvefrom"@rollup/plugin-node-resolve";importreplacefrom"@rollup/plugin-replace";importbabelfrom"@rollup/plugin-babel";importcssfrom"rollup-plugin-css-only";importpostcssfrom"rollup-plugin-postcss";import{terser}from"rollup-plugin-terser";importminimistfrom"minimist";// Get browserslist config and remove ie from es build targetsconstesbrowserslist=fs.readFileSync("./.browserslistrc").toString().split("\n").filter((entry)=>entry&&entry.substring(0,2)!=="ie");// Extract babel preset-env config, to combine with esbrowserslistconstbabelPresetEnvConfig=require("../babel.config").presets.filter((entry)=>entry[0]==="@babel/preset-env")[0][1];constargv=minimist(process.argv.slice(2));constprojectRoot=path.resolve(__dirname,"..");constbaseConfig={input: "src/entry.js",plugins: {preVue: [alias({entries: [{find: "@",replacement: `${path.resolve(projectRoot,"src")}`,},],}),],replace: {"process.env.NODE_ENV": JSON.stringify("production"),},vue: {css: false,template: {isProduction: true,},},postVue: [resolve({extensions: [".js",".jsx",".ts",".tsx",".vue"],}),postcss({extract: true,modules: {generateScopedName: "[name]__[local]___[hash:base64:5]",},}),commonjs(),],babel: {exclude: "node_modules/**",extensions: [".js",".jsx",".ts",".tsx",".vue"],babelHelpers: "bundled",},},};// ESM/UMD/IIFE shared settings: externals// Refer to https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependencyconstexternal=[// list external dependencies, exactly the way it is written in the import statement.// eg. 'jquery'"vue",];// UMD/IIFE shared settings: output.globals// Refer to https://rollupjs.org/guide/en#output-globals for detailsconstglobals={// Provide global variable names to replace your external imports// eg. jquery: '$'vue: "Vue",};// Customize configs for individual targetsconstbuildFormats=[];if(!argv.format||argv.format==="es"){constesConfig={
...baseConfig,input: "src/entry.esm.js",
external,output: {file: "dist/vue-virtual-picklist.esm.js",format: "esm",exports: "named",},plugins: [replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,babel({
...baseConfig.plugins.babel,presets: [["@babel/preset-env",{
...babelPresetEnvConfig,targets: esbrowserslist,},],],}),],};buildFormats.push(esConfig);}if(!argv.format||argv.format==="cjs"){constumdConfig={
...baseConfig,
external,output: {compact: true,file: "dist/vue-virtual-picklist.ssr.js",format: "cjs",name: "VueVirtualPicklist",exports: "auto",
globals,},plugins: [replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,vue({
...baseConfig.plugins.vue,template: {
...baseConfig.plugins.vue.template,optimizeSSR: true,},}),
...baseConfig.plugins.postVue,babel(baseConfig.plugins.babel),],};buildFormats.push(umdConfig);}if(!argv.format||argv.format==="iife"){constunpkgConfig={
...baseConfig,
external,output: {compact: true,file: "dist/vue-virtual-picklist.min.js",format: "iife",name: "VueVirtualPicklist",exports: "auto",
globals,},plugins: [replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,babel(baseConfig.plugins.babel),terser({output: {ecma: 5,},}),],};buildFormats.push(unpkgConfig);}// Export configexportdefaultbuildFormats;
The text was updated successfully, but these errors were encountered:
Im passing a custom generateScopedName using interpolation (https://github.com/madyankin/postcss-modules) and it is not even running. If I change it to modules: true, it works as expected. But I really need to change the name of the classes. I want to append the component's name as a prefix on every class instead of adding a non human hash.
The text was updated successfully, but these errors were encountered: