-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Schock
committed
Apr 25, 2017
1 parent
7890cd6
commit b2b9007
Showing
10 changed files
with
150 additions
and
96 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/assets/js/bundle.js | ||
webpack.conf.js | ||
/assets/dist | ||
stencil.conf.js | ||
webpack.conf.js |
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,4 +1,5 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"indent": [ | ||
2, | ||
|
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,3 @@ | ||
> 1% | ||
last 2 versions | ||
Firefox ESR |
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
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 |
---|---|---|
@@ -1,36 +1,73 @@ | ||
var webpack = require('webpack'); | ||
var CleanWebpackPlugin = require('clean-webpack-plugin'), | ||
config = require('./config.json'), | ||
LodashModuleReplacementPlugin = require('lodash-webpack-plugin'), | ||
path = require('path'), | ||
webpack = require('webpack'); | ||
|
||
module.exports = { | ||
watch: false, | ||
devtool: 'source-map', | ||
bail: true, | ||
context: __dirname, | ||
devtool: 'source-map', | ||
entry: { | ||
'theme-bundle': './assets/js/app.js', | ||
}, | ||
output: { | ||
path: `./assets/dist`, | ||
filename: '[name].js', | ||
main: './assets/js/app.js', | ||
}, | ||
bail: true, | ||
module: { | ||
loaders: [ | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel', | ||
include: /(assets\/js|assets\\js|stencil-utils)/, | ||
query: { | ||
compact: false, | ||
cacheDirectory: true, | ||
presets: ['es2015-loose'], | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
cacheDirectory: true, | ||
compact: true, | ||
minified: true, | ||
plugins: [ | ||
'dynamic-import-webpack', // Needed for dynamic imports. | ||
'lodash', // Automagically tree-shakes lodash. | ||
'transform-regenerator', // Transforms async and generator functions. | ||
], | ||
presets: [ | ||
['env', { | ||
loose: true, // Enable "loose" transformations for any plugins in this preset that allow them. | ||
modules: false, // Don't transform modules; needed for tree-shaking. | ||
useBuiltIns: true, // Tree-shake babel-polyfill. | ||
}], | ||
], | ||
} | ||
} | ||
} | ||
] | ||
], | ||
}, | ||
output: { | ||
chunkFilename: 'theme-bundle.chunk.[name].js', | ||
filename: 'theme-bundle.[name].js', | ||
path: path.resolve(__dirname, "assets/dist"), | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin(['assets/dist'], { | ||
verbose: true, | ||
watch: false, | ||
}), | ||
new webpack.LoaderOptionsPlugin({ | ||
minimize: true, | ||
}), | ||
new LodashModuleReplacementPlugin, // Complements 'babel-plugin-lodash by shrinking it's cherry-picked builds further. | ||
new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery', | ||
'window.jQuery': 'jquery', | ||
}) | ||
}), | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
children: true, | ||
minChunks: 2, | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
jquery: path.resolve(__dirname, 'node_modules/jquery/dist/jquery.min.js'), | ||
jstree: path.resolve(__dirname, 'node_modules/jstree/dist/jstree.min.js'), | ||
}, | ||
}, | ||
watch: false, | ||
}; |