Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit d12a126

Browse files
chore(build): Add license header to top of built files (#85)
Needed for OSS compliance
1 parent 982f3f7 commit d12a126

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

webpack.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
const path = require('path');
2020
const glob = require('glob');
21+
const webpack = require('webpack');
2122
const ExtractTextPlugin = require('extract-text-webpack-plugin');
2223

2324
const OUT_PATH = path.resolve('./build');
@@ -26,6 +27,17 @@ const PUBLIC_PATH = '/assets/';
2627
const IS_DEV = process.env.MDC_ENV === 'development';
2728
const 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+
2941
module.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 [

0 commit comments

Comments
 (0)