1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-10 10:26:38 +02:00

Migrating to webpack 2

This commit is contained in:
Max Guglielmi 2017-01-29 22:50:12 +11:00
parent fe3e2dcb67
commit 00b339954b
3 changed files with 35 additions and 22 deletions

View file

@ -1,6 +1,6 @@
{
"name": "tablefilter",
"version": "0.4.38",
"version": "0.4.39",
"description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT",
"author": {
@ -64,7 +64,7 @@
"script-loader": "^0.7.0",
"string-replace-webpack-plugin": "^0.0.5",
"sugar-date": "2.0.4",
"webpack": "^1.14.0",
"webpack": "^2.2.0",
"webpack-dev-server": "^1.16.2"
},
"dependencies": {},

View file

@ -18,13 +18,13 @@ module.exports = {
libraryTarget: 'umd'
},
resolve: {
extensions: ['', '.js'],
extensions: ['.js'],
alias: {
sortabletable: '../../../libs/sortabletable.js'
}
},
module: {
loaders: [
rules: [
{
test: path.join(__dirname, 'src'),
exclude: /tablefilter\/node_modules/,
@ -66,20 +66,22 @@ module.exports = {
warnings: false
}
}),
new webpack.BannerPlugin(
'/** \n' +
new webpack.BannerPlugin({
banner: '/** \n' +
' *\t '+pkg.name+' v'+pkg.version+' by '+pkg.author.name+'\n' +
' *\t build date: '+ new Date().toISOString() +' \n' +
' *\t MIT License \n' +
' */ \n',
{ raw: true }
)
raw: true
})
]
},
dev: {
devtool: 'source-map',
debug: true,
plugins: [
new webpack.LoaderOptionsPlugin({
debug: true
}),
new webpack.optimize.DedupePlugin(),
new StringReplacePlugin()
]

View file

@ -10,22 +10,31 @@ module.exports = {
entry: webpackConfig.entry,
output: webpackConfig.output,
resolve: webpackConfig.resolve,
isparta: {
embedSource: true,
noAutoWrap: true,
babel: {
compact: false,
presets: ['es2015'],
plugins: [['transform-es2015-classes', {loose: true}]]
}
},
// isparta: {
// embedSource: true,
// noAutoWrap: true,
// babel: {
// compact: false,
// presets: ['es2015'],
// plugins: [['transform-es2015-classes', {loose: true}]]
// }
// },
module: {
loaders: [
rules: [
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
exclude: /tablefilter\/node_modules/,
loader: 'isparta'
loader: 'isparta-loader',
options: {
embedSource: true,
noAutoWrap: true,
babel: {
compact: false,
presets: ['es2015'],
plugins: [['transform-es2015-classes', {loose: true}]]
}
}
},
{
test: path.join(__dirname, 'src'),
@ -46,6 +55,8 @@ module.exports = {
]
},
devtool: 'sourcemap',
debug: true,
plugins: [new Clean(['dist'])].concat(webpackConfig.dev.plugins)
plugins: [
new Clean(['dist']),
].concat(webpackConfig.dev.plugins)
};