Git Product home page Git Product logo

Comments (7)

Maximaximum avatar Maximaximum commented on June 12, 2024

This is relevant to #96

from object-fit-images.

Maximaximum avatar Maximaximum commented on June 12, 2024

PR: #106

from object-fit-images.

fregante avatar fregante commented on June 12, 2024

I never used it that way with webpack, what are you using? What’s your config?

from object-fit-images.

Maximaximum avatar Maximaximum commented on June 12, 2024

Did you try to use it like import objectFitImages from 'object-fit-images';? Does it work for you?

My webpack.config:

const path = require('path');
const webpack = require('webpack');

module.exports = {
  devtool: 'inline-source-map',
  mode: 'development',
  entry: {
    app: './entry.app.ts',
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: [
          'ng-annotate-loader',
          'ts-loader',
        ],
        exclude: /node_modules/
      },
      {
        test: /environments\\dev\.json$/,
        use: [{
          loader: 'ng-constants-json-loader',
          options: {
            moduleName: 'ems-config'
          }
        }],
        type: "javascript/auto"
      }
    ]
  },
  optimization: {
    splitChunks: {
      chunks: "all",
      minSize: 30000,
      minChunks: 1,
      maxAsyncRequests: 5,
      maxInitialRequests: 3,
      automaticNameDelimiter: '~',
      name: true,
      cacheGroups: {
        vendors: {
          test: /[\\/]node_modules[\\/]/,
          priority: -10,
          name: "vendor"
        },
        default: {
          minChunks: 2,
          priority: -20,
          reuseExistingChunk: true
        }
      }
    }
  },
  output: {
    chunkFilename: '[name].js',
    filename: '[name].js',
    path: path.resolve(__dirname, 'build/app')
  },
  plugins: [
    new webpack.ProvidePlugin({
      $: "jquery",
      jQuery: "jquery",
      "window.jQuery": "jquery"
    }),
    new webpack.ProvidePlugin({
      Handsontable: "handsontable/dist/handsontable.full.js",
    }),
    new webpack.ContextReplacementPlugin(
      // Workaround to avoid loading locales that are not used https://github.com/moment/moment/issues/2517
      /moment[\/\\]locale$/,
      /-----/ // Do not include any locales
    )
  ],
  resolve: {
    extensions: ['.ts', '.js'],
    modules: [path.resolve(__dirname, "src/"), "node_modules"]
  }
};

from object-fit-images.

fregante avatar fregante commented on June 12, 2024

You’re using typescript, for whatever reason they have their own incompatible import syntax.

from object-fit-images.

fregante avatar fregante commented on June 12, 2024

https://blog.jdriven.com/2017/06/typescript-and-es6-import-syntax/

from object-fit-images.

Maximaximum avatar Maximaximum commented on June 12, 2024

Hm, that's weird, but if you don't think it should be in the package documentation - ok

from object-fit-images.

Related Issues (20)

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.