1

I have a typescript file called DropdownMenu.ts which looks like this

import DropdownMenuItem from './DropdownMenuItem';
import { createElem } from '../timeline/utils';
import { Dispatcher } from '../timeline/utils';
import { transition } from 'd3-transition';
// import './dropdown-menu.scss';

export default class DropdownMenu {
    // code omitted
}

I am using sass-loader and css-loader to process the sass file and output a separate css file for it. If I comment out the import statement for the sass style sheet, webpack's CommonsChunkPlugin generates the bundle with the correct amount of code. But if I remove the comment on the import statement for the stylesheet, then look inside the generated bundle file called DropdownMenu.js for this typescript module, webpack has added a huge amount of code for the css loader to work. Is there a way to remove these code or is it possible?

Trash Can
  • 6,608
  • 5
  • 24
  • 38

0 Answers0