-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] moving webpack scripts to scripts folder.
- Loading branch information
Showing
10 changed files
with
93 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
mode: 'development', | ||
output: { | ||
filename: '[name].js', | ||
path: path.resolve(__dirname, './examples/__build__'), | ||
publicPath: '/__build__/' | ||
}, | ||
module: { | ||
rules: [ | ||
{ test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader' } } | ||
] | ||
}, | ||
resolve: { | ||
alias: { | ||
"react-modal": path.resolve(__dirname, "../src") | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const defaultConfig = require('./defaultConfig'); | ||
|
||
var EXAMPLES_DIR = path.resolve(__dirname, '../examples'); | ||
|
||
function isDirectory(dir) { | ||
return fs.lstatSync(dir).isDirectory(); | ||
} | ||
|
||
function buildEntries() { | ||
return fs.readdirSync(EXAMPLES_DIR).reduce(function (entries, dir) { | ||
if (dir === 'build') | ||
return entries; | ||
|
||
var isDraft = dir.charAt(0) === '_'; | ||
|
||
if (!isDraft && isDirectory(path.join(EXAMPLES_DIR, dir))) | ||
entries[dir] = path.join(EXAMPLES_DIR, dir, 'app.js'); | ||
|
||
return entries; | ||
}, {}); | ||
} | ||
|
||
module.exports = { | ||
...defaultConfig, | ||
entry: buildEntries(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,45 @@ | ||
var webpack = require('webpack'); | ||
var path = require('path'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const defaultConfig = require('./defaultConfig'); | ||
|
||
var reactExternal = { | ||
const reactExternal = { | ||
root: 'React', | ||
commonjs2: 'react', | ||
commonjs: 'react', | ||
amd: 'react' | ||
}; | ||
var reactDOMExternal = { | ||
const reactDOMExternal = { | ||
root: 'ReactDOM', | ||
commonjs2: 'react-dom', | ||
commonjs: 'react-dom', | ||
amd: 'react-dom' | ||
}; | ||
|
||
module.exports = { | ||
...defaultConfig, | ||
mode: 'production', | ||
|
||
entry: { | ||
'react-modal': './src/index.js', | ||
'react-modal.min': './src/index.js' | ||
'react-modal': path.resolve(__dirname, '../src/index.js'), | ||
'react-modal.min': path.resolve(__dirname, '../src/index.js') | ||
}, | ||
|
||
externals: { | ||
'react': reactExternal, | ||
'react-dom': reactDOMExternal | ||
}, | ||
|
||
output: { | ||
filename: '[name].js', | ||
chunkFilename: '[id].chunk.js', | ||
path: path.resolve(__dirname, 'dist'), | ||
path: path.resolve(__dirname, '../dist'), | ||
publicPath: '/', | ||
libraryTarget: 'umd', | ||
library: 'ReactModal' | ||
}, | ||
|
||
optimization: { | ||
minimize: true | ||
}, | ||
|
||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
}) | ||
], | ||
|
||
module: { | ||
rules: [ | ||
{ test: /\.js?$/, exclude: /node_modules/, use: { loader: 'babel-loader' } } | ||
] | ||
} | ||
|
||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const path = require('path'); | ||
const defaultConfig = require('./defaultConfig'); | ||
|
||
module.exports = { | ||
...defaultConfig, | ||
plugins: [], | ||
entry: path.resolve(__dirname, '../specs/index.js'), | ||
devtool: 'inline-source-map', | ||
module: { | ||
...defaultConfig.module, | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: { loader: 'istanbul-instrumenter-loader' }, | ||
enforce: 'post', | ||
include: path.resolve(__dirname, '../src') | ||
}, | ||
...defaultConfig.module.rules | ||
] | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.