Skip to content

how to extend webpack config? #1308

Closed
Closed
@c0b

Description

@c0b

I'm using this create-react-app to start a new react project, want to use components from material-components-web; while a first problem met is the transpiled script contains import and export which browser doesn't understand, I guess it's because the builtin webpack.config has an exclusion of all code under ^node_modules/, it transpiles only user's app code; is this true?

https://github.com/material-components/material-components-web#javascript

I tested the similar NYTimes/kyt project, that exposes a modifywebpackconfig interface for users to easily tweak webpack config somewhat; wonder if this create-react-app has some similar easy way of webpack customization? I feel like the eject to make copies of all builtin webpack config stuff is the only option here?

https://github.com/NYTimes/kyt/blob/master/docs/kytConfig.md#modifywebpackconfig

/* 272 */
/*!***************************************!*\
  !*** ./~/@material/checkbox/index.js ***!
  \***************************************/
/***/ function(module, exports) {

	/**
	 * Copyright 2016 Google Inc. All Rights Reserved.
	 *
	 * Licensed under the Apache License, Version 2.0 (the "License");
	 * you may not use this file except in compliance with the License.
	 * You may obtain a copy of the License at
	 *
	 *      http://www.apache.org/licenses/LICENSE-2.0
	 *
	 * Unless required by applicable law or agreed to in writing, software
	 * distributed under the License is distributed on an "AS IS" BASIS,
	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 * See the License for the specific language governing permissions and
	 * limitations under the License.
	 */

	import {MDCComponent} from '@material/base';
	import MDCCheckboxFoundation from './foundation';

	export {MDCCheckboxFoundation};

	export class MDCCheckbox extends MDCComponent {
	  static attachTo(root) {
	    return new MDCCheckbox(root);
	  }

    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions