-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from drewhamlett/master
Support extra plugins in config (such as UglifyJS)
- Loading branch information
Showing
10 changed files
with
2,298 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>AutoDllPlugin Basic Setup</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
|
||
<script src="dist/vendor.dll.js"></script> | ||
<script src="dist/app.bundle.js"></script> | ||
</body> | ||
</html> |
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,18 @@ | ||
{ | ||
"name": "basic", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "webpack --config ./webpack.config.js" | ||
}, | ||
"devDependencies": { | ||
"autodll-webpack-plugin": "file:../../", | ||
"webpack": "^3.0.0" | ||
}, | ||
"dependencies": { | ||
"moment": "^2.18.1", | ||
"react": "^15.6.1", | ||
"react-dom": "^15.6.1" | ||
} | ||
} |
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,11 @@ | ||
const moment = require('moment'); | ||
const React = require('react'); | ||
const ReactDOM = require('react-dom'); | ||
const createElement = React.createElement; | ||
|
||
const Test = createElement('div', {}, [ | ||
createElement('h1', {}, [ 'AutoDllPlugin Basic Setup' ]), | ||
createElement('p', {}, [ moment().format('LLLL') ]) | ||
]); | ||
|
||
ReactDOM.render(Test, document.getElementById('root')) |
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,31 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const AutoDllPlugin = require('autodll-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: { | ||
app: './src/index.js' | ||
}, | ||
|
||
output: { | ||
filename: '[name].bundle.js', | ||
path: path.resolve(__dirname, 'dist') | ||
}, | ||
|
||
plugins: [ | ||
new AutoDllPlugin({ | ||
context: __dirname, | ||
filename: '[name].dll.js', | ||
entry: { | ||
vendor: [ | ||
'react', | ||
'react-dom', | ||
'moment' | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin(), | ||
] | ||
}) | ||
] | ||
}; |
Oops, something went wrong.