Не работает w2ui, если делать сборку webpack'ом. При подключении w2ui скриптом на html странице, все нормально.
Содержимое файла с импортом библиотек:
require('../libs/jquery/jquery-ui.css');
window.$ = window.jQuery = require('jquery');
require('jquery.browser');
require('jquery-ui');
require('w2ui/w2ui-1.4.2.min');
require('w2ui/w2ui-1.4.2.min.css');
require('../libs/gwtk.css');
require('../libs/gwtkse.js');
webpack.config:
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
'app': './src/app.js'
},
output: {
path: './build',
filename: `[name].min.js`,
chunkFilename: '[name].min.js',
// publicPath: 'http://localhost:3000/'
},
devServer: {
outputPath: './dist',
port: 3000,
hot: true
},
resolve: {
extensions: ['', '.js']
},
// devtool: 'source-map',
module: {
loaders: [
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.css$/, loader: ExtractTextPlugin.extract("css?sourceMap!postcss")},
{test: /\.less$/, loader: ExtractTextPlugin.extract('css?sourceMap!postcss!less?sourceMap')},
{test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
{test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"},
{test: /\.(png|jpg)$/, loader: 'file?name=img/[name].[ext]'},
{test: /\.html$/, loader: 'raw'}
]
},
postcss: function () {
return [precss, autoprefixer];
},
plugins: [
new CleanWebpackPlugin('./build', {root: `${__dirname}/..`}),
new ExtractTextPlugin(`[name].min.css`, {allChunks: true}),
new HtmlWebpackPlugin({template: './index.html'})
]
};