Giter Site home page Giter Site logo

vite-plugin-optimizer's People

Contributors

caoxiemeihao avatar charleewa avatar learnsomesome avatar yejimeiming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vite-plugin-optimizer's Issues

When vite config resolve.alias is array have a bug

if (typeof config.resolve.alias === 'object') {
config.resolve.alias = Object
.entries(config.resolve.alias)
.reduce((memo, [find, replacement]) => memo.concat({ find, replacement }), []);
}

In your code, when resolve.alias is array,resolve.alias will be inoperative

vite.config.ts引用失败

There are types at 'electron-project/node_modules/vite-plugin-optimizer/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vite-plugin-optimizer' library may need to update its package.json or typings

vite4 require is not defined

vite4 require is not defined when this plugin is configured , this is my `vite.config.ts

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import optimizer from "vite-plugin-optimizer";

let getReplacer = () => {
  let externalModels = ["os", "fs", "path", "events", "child_process", "crypto", "http", "buffer", "url", "better-sqlite3", "knex", "stream"];
  let result = {};
  for (let item of externalModels) {
    result[item] = () => ({
      find: new RegExp(`^${item}$`),
      code: `const ${item} = require('${item}');export { ${item} as default }`,
    });
  }
  return result;
};

export default defineConfig({
  plugins: [
    optimizer(getReplacer()),
    vue()
  ],
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.