Skip to content

Commit

Permalink
Create config module that contains webpack common configuration | Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
victorg1991 authored and Carlos Lancha committed Jul 9, 2018
1 parent 3d9e4e2 commit 1369f94
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/clay-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "clay-config",
"version": "2.1.12",
"description": "Configuration files for Clay components",
"license": "BSD",
"main": "src/all/config.js",
"repository": "https://github.com/liferay/clay/tree/master/packages/clay-config",
"dependencies": {
"webpack": "^3.0.0"
}
}
5 changes: 5 additions & 0 deletions packages/clay-config/src/all/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const webpackCommonConfig = require('../webpack-common.config');

module.exports = {
webpackCommonConfig
}
29 changes: 29 additions & 0 deletions packages/clay-config/src/webpack-common.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const webpack = require('webpack');

module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
compact: false,
presets: ['babel-preset-env'],
plugins: ['babel-plugin-transform-node-env-inline'],
},
},
},
],
},
devtool: 'cheap-module-source-map',
output: {
library: 'metal',
libraryTarget: 'this',
},
plugins: [new webpack.optimize.ModuleConcatenationPlugin()],
resolve: {
mainFields: ['esnext:main', 'main'],
},
};

0 comments on commit 1369f94

Please sign in to comment.