egoist / bili

Bili makes it easier to bundle JavaScript libraries.

Home Page:https://bili.egoist.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange Lines on top on build/index.js file

loicgeek opened this issue · comments

I have created my vue plugin but there are errors when I built with bili, these lines appear on top of the build/index.js file

/*!
 * vue-easy-printer v1.0.0
 * (c) loicgeek
 * Released under the MIT License.
 */
'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var __vue_normalize__ = _interopDefault(require('F:PERSONNAL�ue-easy-printer
ode_modules
ollup-plugin-vue
untime
ormalize.js'));
var __vue_create_injector__ = _interopDefault(require('F:PERSONNAL�ue-easy-printer
ode_modules
ollup-plugin-vue
untime�rowser.js'));

that is my package.json file

  "name": "vue-easy-printer",
  "version": "1.0.0",
  "private": false,
  "description": "The Best Vue Plugin To convert Html page, Components to pdf",
  "main": "./dist/index.js",
  "keywords": [
    "Vuejs",
    "html",
    "pdf"
  ],
  "files": [
    "dist/*"
  ],
  "scripts": {
    "build": "bili --name index --plugin vue "
  },
  "author": "loicgeek",
  "license": "MIT",
  "devDependencies": {
    "bili": "^4.8.1",
    "rollup-plugin-vue": "^5.1.2",
    "vue-template-compiler": "^2.6.10"
  }
}

And my bili.config.js file

module.exports = {
  banner: true,
  output: {
    extractCSS: false,
  },
  plugins: {
    vue: {
      css: true
    }
  }
}; 

To run the build process , i ran :

 npx bili --bundle-node-modules

I am encountering the exact strange issue:

import __vue_normalize__ from 'C:projectsVueGoodTable�ue-good-table
ode_modules
ollup-plugin-vue
untime
ormalize.js';

The first letter of (n)ode_modules, (r)ollup-plugin-vue, (r)untime, (n)ormalize.js are all missing.
Another observation is the lack of '/' in the folder path and the unrecognized character.
I would expect: 'C:projects/VueGoodTable/vue-good-table'

My Config:

module.exports = {
  banner,
  output: {
    fileName: (context, defaultFileName) => {
      if (context.format === 'umd' || context.format === 'umd-min') {
        return 'vue-good-table[min].js';
      }
      return 'vue-good-table.[format].js';
    },
    moduleName: 'vue-good-table',
    format: [
      'cjs',
      'es',
      'umd',
      'umd-min',
    ],
  },
  plugins: {
    commonjs: true,
    vue: {
      css: false,
    },
  },
  bundleNodeModules: true,
};

Update: I believe this is only occurring on Windows. My colleague was able to run the exact command with the exact configuration without any issues on his Linux machine.

rollup-plugin-vue is broken in version 5.1.2. Version 5.1.1 works fine.

This is not actually related to Bili but rollup-plugin-vue.
vuejs/rollup-plugin-vue#303

how to fix it? is there a way to tell bili to user a other version

how to fix it? is there a way to tell bili to user a other version

downgrade rollup-plugin-vue to 5.1.1

ah lol i trought its built in

commented

Not a bug of bili. Closed by #343