-
카테고리
-
해결 여부
미해결
BootStrap을 적용하고 싶습니다.
18.09.24 21:38 작성 조회수 139
0
css파일 js로 import하는 영상보고 작성해봤는데 적용이 안되서 질문드립니다. 혹시 외부라이브러리는 다른 설정방법이 있나요?
[HTML]
<!DOCTYPE html>
<html lang="ko">
helloworld
ID
PW
Cancle
[bootstrap.js]
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap';
import 'bootstrap/js/dist/util';
import 'bootstrap/js/dist/dropdown';
[config]
const webpack = require('webpack');
const path = require('path');
const webpackMerge = require('webpack-merge');
const CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
const config = {
entry: {
helloworld: path.resolve(dirname, 'src/main/resources/static/js/helloworld.js'),
vendor: ['jquery'],
background: path.resolve(dirname, 'src/main/resources/templates/myStyle.css'),
bootstrap: path.resolve(dirname, 'src/main/resources/static/js/bootstrap.js')
},
output: {
path: path.resolve(dirname, 'src/main/resources/static/dist/js'),
filename: '[name].js'
},
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
presets: [
['es2015', {modules: false}]
]
}
}]
},
{
test: /.css$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins : [
new webpack.ProvidePlugin({
$ : "jquery",
jQuery : "jquery"
}),
new CommonsChunkPlugin({ name: "vendor"
})
]
};
module.exports = function(env) {
return webpackMerge(config, require(./webpack.${env}.js
))
};
답변을 작성해보세요.
답변 0