Code Monkey home page Code Monkey logo

Comments (5)

bodia-uz avatar bodia-uz commented on May 28, 2024 1

Published version 1.0.0-1 with fix.

from odata-filter-builder.

bodia-uz avatar bodia-uz commented on May 28, 2024

Hi @jgornick.
Library distributed with es5:

  1. umd:
    https://unpkg.com/[email protected]/dist/odata-filter-builder.js
  2. commonjs:
    https://unpkg.com/[email protected]/lib/ODataFilterBuilder.js

Could you describe what is wrong in IE?

from odata-filter-builder.

jgornick avatar jgornick commented on May 28, 2024

I suppose when I'm using TypeScript and importing like:

import { ODataFilterBuilder } from 'odata-filter-builder';

My output via webpack is using the src/ODataFilterBuilder.js defined via module in package.json. This should be using the main lib/ODataFilterBuilder.js.

If I remove module then my build uses the ES5 version of the script in lib.

Thoughts?

from odata-filter-builder.

bodia-uz avatar bodia-uz commented on May 28, 2024

I see.
For module field, we need transpile our source to es5, with import/export declaration (https://rollupjs.org/guide/en#output-format-f-format)

As a workaround, you could include odata-filter-builder to your typescript loader, or remove module field from mainFields:

mainFields: ["main"]

Fill free to create PR.
It should be something like:

{
  "module": "es/ODataFilterBuilder.js",
  ...
  "scripts": {
    ...
    "build:es": "rollup -c -f es src/ODataFilterBuilder.js > es/ODataFilterBuilder.js",
    ...
  }
}

from odata-filter-builder.

jgornick avatar jgornick commented on May 28, 2024

I ended up fixing in my webpack config like:

resolve: {
  alias: {
    'odata-filter-builder': path.resolve(
      helpers.root('node_modules'),
      'odata-filter-builder',
      'lib',
      'ODataFilterBuilder.js'
    )
  }
}

However, I do agree that by default the module and/or main in the distributed package.json point to an ES5 version.

I'll try to get something together for this and submit a PR.

from odata-filter-builder.

Related Issues (12)

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.