This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1818
1919const path = require ( 'path' ) ;
2020const glob = require ( 'glob' ) ;
21+ const webpack = require ( 'webpack' ) ;
2122const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
2223
2324const OUT_PATH = path . resolve ( './build' ) ;
@@ -26,6 +27,17 @@ const PUBLIC_PATH = '/assets/';
2627const IS_DEV = process . env . MDC_ENV === 'development' ;
2728const IS_PROD = process . env . MDC_ENV === 'production' ;
2829
30+ const createBannerPlugin = ( ) => new webpack . BannerPlugin ( [
31+ '/*!' ,
32+ ' Material Components for web' ,
33+ ` Copyright (c) ${ new Date ( ) . getFullYear ( ) } Google Inc.` ,
34+ ' License: Apache-2.0' ,
35+ '*/' ,
36+ ] . join ( '\n' ) , {
37+ raw : true ,
38+ entryOnly : true ,
39+ } ) ;
40+
2941module . exports = [ {
3042 name : 'js-components' ,
3143 entry : {
@@ -59,6 +71,9 @@ module.exports = [{
5971 loader : 'json-loader' ,
6072 } ] ,
6173 } ,
74+ plugins : [
75+ createBannerPlugin ( ) ,
76+ ] ,
6277} , {
6378 name : 'js-all' ,
6479 entry : path . resolve ( './packages/material-components-web/index.js' ) ,
@@ -77,6 +92,9 @@ module.exports = [{
7792 loader : 'babel-loader' ,
7893 } ] ,
7994 } ,
95+ plugins : [
96+ createBannerPlugin ( ) ,
97+ ] ,
8098} , {
8199 name : 'css' ,
82100 entry : {
@@ -123,6 +141,7 @@ module.exports = [{
123141 } ,
124142 plugins : [
125143 new ExtractTextPlugin ( '[name].' + ( IS_PROD ? 'min.' : '' ) + 'css' ) ,
144+ createBannerPlugin ( ) ,
126145 ] ,
127146 postcss : function ( ) {
128147 return [
You can’t perform that action at this time.
0 commit comments